From 96e97e8730d25ca5dbc20ee8c7f158147ba5c54f Mon Sep 17 00:00:00 2001 From: Chris Doyle Date: Mon, 12 Jan 2026 19:08:51 +0000 Subject: [PATCH 1/7] Updates the AUTO_TFVARS_COUNTER to increment in decimal not octal numbers --- image/actions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/image/actions.sh b/image/actions.sh index dc9bbd9a..080a3ca9 100644 --- a/image/actions.sh +++ b/image/actions.sh @@ -423,7 +423,7 @@ function create-auto-tfvars() { debug_log "Creating autoloading tfvars file for $file_path: $link_name" cp "$file_path" "$INPUT_PATH/$link_name" - AUTO_TFVARS_COUNTER=$(printf "%02d\n" "$((AUTO_TFVARS_COUNTER + 1))") + AUTO_TFVARS_COUNTER=$(printf "%02d\n" "$((10#${AUTO_TFVARS_COUNTER} + 1))") done fi From 3cb3ebe16c2a2e7ecd5ba71642d16fb171eb7802 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Tue, 13 Jan 2026 11:33:49 +0000 Subject: [PATCH 2/7] Add plan_multiple_var_files test --- .github/workflows/test-plan.yaml | 41 ++++++++++++++ .../test-plan/multiple_var_files/main.tf | 53 +++++++++++++++++++ 2 files changed, 94 insertions(+) create mode 100644 tests/workflows/test-plan/multiple_var_files/main.tf diff --git a/.github/workflows/test-plan.yaml b/.github/workflows/test-plan.yaml index d539efa6..4f0f413c 100644 --- a/.github/workflows/test-plan.yaml +++ b/.github/workflows/test-plan.yaml @@ -887,6 +887,47 @@ jobs: variables: | my_sensitive_string = "password123" + plan_multiple_var_files: + runs-on: ubuntu-24.04 + name: Plan multiple var files + permissions: + contents: read + pull-requests: write + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Plan + uses: ./terraform-plan + id: plan + with: + add_github_comment: false + path: tests/workflows/test-plan/multiple_var_files + var_file: | + tests/workflows/test-plan/multiple_var_files/var1.tfvars + tests/workflows/test-plan/multiple_var_files/var2.tfvars + tests/workflows/test-plan/multiple_var_files/var3.tfvars + tests/workflows/test-plan/multiple_var_files/var4.tfvars + tests/workflows/test-plan/multiple_var_files/var5.tfvars + tests/workflows/test-plan/multiple_var_files/var6.tfvars + tests/workflows/test-plan/multiple_var_files/var7.tfvars + tests/workflows/test-plan/multiple_var_files/var8.tfvars + tests/workflows/test-plan/multiple_var_files/var9.tfvars + variables: | + var_from_input = "ten" + + - name: Verify outputs + env: + ALL_VARS: ${{ steps.plan.outputs.all_vars }} + run: | + if [[ "$ALL_VARS" != "one-two-three-four-five-six-seven-eight-nine-ten" ]]; then + echo "Expected all_vars output to be 'one-two-three-four-five-six-seven-eight-nine-ten', got '$ALL_VARS'" + exit 1 + fi plan_sensitive_variables: runs-on: ubuntu-24.04 diff --git a/tests/workflows/test-plan/multiple_var_files/main.tf b/tests/workflows/test-plan/multiple_var_files/main.tf new file mode 100644 index 00000000..fe931f9c --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/main.tf @@ -0,0 +1,53 @@ +variable "var1" { + type = string + default = "" +} + +variable "var2" { + type = string + default = "" +} + +variable "var3" { + type = string + default = "" +} + +variable "var4" { + type = string + default = "" +} + +variable "var5" { + type = string + default = "" +} + +variable "var6" { + type = string + default = "" +} + +variable "var7" { + type = string + default = "" +} + +variable "var8" { + type = string + default = "" +} + +variable "var9" { + type = string + default = "" +} + +variable "var_from_input" { + type = string + default = "" +} + +output "all_vars" { + value = "${var.var1}-${var.var2}-${var.var3}-${var.var4}-${var.var5}-${var.var6}-${var.var7}-${var.var8}-${var.var9}-${var.var_from_input}" +} From fc8291ce1afde79540d94b1a13317408c072735f Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Tue, 13 Jan 2026 11:43:54 +0000 Subject: [PATCH 3/7] Add plan_multiple_var_files test --- .github/actionlint.yaml | 1 + tests/workflows/test-plan/multiple_var_files/var1.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var2.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var3.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var4.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var5.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var6.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var7.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var8.tfvars | 1 + tests/workflows/test-plan/multiple_var_files/var9.tfvars | 1 + 10 files changed, 10 insertions(+) create mode 100644 tests/workflows/test-plan/multiple_var_files/var1.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var2.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var3.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var4.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var5.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var6.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var7.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var8.tfvars create mode 100644 tests/workflows/test-plan/multiple_var_files/var9.tfvars diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 4abdd4bb..f58e9187 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -30,6 +30,7 @@ paths: - 'property "git_https" is not defined in object type' - 'property "awkward_.*" is not defined in object type' - 'property "word" is not defined in object type' + - 'property "all_vars" is not defined in object type' .github/workflows/test-target-replace-exclude.yaml: ignore: - 'property "count" is not defined in object type' diff --git a/tests/workflows/test-plan/multiple_var_files/var1.tfvars b/tests/workflows/test-plan/multiple_var_files/var1.tfvars new file mode 100644 index 00000000..299ffe91 --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var1.tfvars @@ -0,0 +1 @@ +var1 = "one" diff --git a/tests/workflows/test-plan/multiple_var_files/var2.tfvars b/tests/workflows/test-plan/multiple_var_files/var2.tfvars new file mode 100644 index 00000000..2657f340 --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var2.tfvars @@ -0,0 +1 @@ +var2 = "two" diff --git a/tests/workflows/test-plan/multiple_var_files/var3.tfvars b/tests/workflows/test-plan/multiple_var_files/var3.tfvars new file mode 100644 index 00000000..64111e0c --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var3.tfvars @@ -0,0 +1 @@ +var3 = "three" diff --git a/tests/workflows/test-plan/multiple_var_files/var4.tfvars b/tests/workflows/test-plan/multiple_var_files/var4.tfvars new file mode 100644 index 00000000..ae5de9c5 --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var4.tfvars @@ -0,0 +1 @@ +var4 = "four" diff --git a/tests/workflows/test-plan/multiple_var_files/var5.tfvars b/tests/workflows/test-plan/multiple_var_files/var5.tfvars new file mode 100644 index 00000000..fbb4e7af --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var5.tfvars @@ -0,0 +1 @@ +var5 = "five" diff --git a/tests/workflows/test-plan/multiple_var_files/var6.tfvars b/tests/workflows/test-plan/multiple_var_files/var6.tfvars new file mode 100644 index 00000000..ece1efef --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var6.tfvars @@ -0,0 +1 @@ +var6 = "six" diff --git a/tests/workflows/test-plan/multiple_var_files/var7.tfvars b/tests/workflows/test-plan/multiple_var_files/var7.tfvars new file mode 100644 index 00000000..d6e1dd88 --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var7.tfvars @@ -0,0 +1 @@ +var7 = "seven" diff --git a/tests/workflows/test-plan/multiple_var_files/var8.tfvars b/tests/workflows/test-plan/multiple_var_files/var8.tfvars new file mode 100644 index 00000000..f6ab2d9a --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var8.tfvars @@ -0,0 +1 @@ +var8 = "eight" diff --git a/tests/workflows/test-plan/multiple_var_files/var9.tfvars b/tests/workflows/test-plan/multiple_var_files/var9.tfvars new file mode 100644 index 00000000..b18270ef --- /dev/null +++ b/tests/workflows/test-plan/multiple_var_files/var9.tfvars @@ -0,0 +1 @@ +var9 = "nine" From 2716296ccf89621dc16c8763020c13f40a6f6275 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Tue, 13 Jan 2026 11:44:11 +0000 Subject: [PATCH 4/7] Update latest version test --- .github/workflows/test-version.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-version.yaml b/.github/workflows/test-version.yaml index 0ac87029..37cc15da 100644 --- a/.github/workflows/test-version.yaml +++ b/.github/workflows/test-version.yaml @@ -611,7 +611,7 @@ jobs: run: | echo "The terraform version was $DETECTED_TERRAFORM_VERSION" - if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.12"* ]]; then + if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.14"* ]]; then echo "::error:: Latest version was not used" exit 1 fi @@ -632,7 +632,7 @@ jobs: run: | echo "The terraform version was $DETECTED_TERRAFORM_VERSION" - if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.12"* ]]; then + if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.14"* ]]; then echo "::error:: Latest version was not used" exit 1 fi From 774146d4890fc6f2eaa8748fd34a948383e341d7 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Tue, 13 Jan 2026 12:13:47 +0000 Subject: [PATCH 5/7] Update action pins --- .github/workflows/base-image.yaml | 2 +- .github/workflows/release.yaml | 4 ++-- .github/workflows/test.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/base-image.yaml b/.github/workflows/base-image.yaml index 5bfb1217..8b437a82 100644 --- a/.github/workflows/base-image.yaml +++ b/.github/workflows/base-image.yaml @@ -36,7 +36,7 @@ jobs: echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - name: Base image id: build-and-push diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ab475eb7..050ff879 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -43,7 +43,7 @@ jobs: echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - name: Build action image id: image_build @@ -206,7 +206,7 @@ jobs: echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin - name: Set up Docker Buildx - uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0 - name: Tag and push base image with release version env: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 38a307c8..a1eb5816 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -142,6 +142,6 @@ jobs: V8R_CONFIG_FILE=.config/.v8rrc.yaml npx v8r --ignore-errors - - uses: astral-sh/ruff-action@9828f49eb4cadf267b40eaa330295c412c68c1f9 # v3 + - uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1 with: args: --config=.config/ruff.toml check From 8e7b7effcfcdee77cd2f2e4e87fcbbcf0969e0db Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Tue, 13 Jan 2026 13:08:35 +0000 Subject: [PATCH 6/7] We need to apply to assert the outputs --- .github/workflows/test-apply.yaml | 37 ++++++++++++++++ .github/workflows/test-plan.yaml | 42 ------------------- .../multiple_var_files/main.tf | 0 .../multiple_var_files/var1.tfvars | 0 .../multiple_var_files/var2.tfvars | 0 .../multiple_var_files/var3.tfvars | 0 .../multiple_var_files/var4.tfvars | 0 .../multiple_var_files/var5.tfvars | 0 .../multiple_var_files/var6.tfvars | 0 .../multiple_var_files/var7.tfvars | 0 .../multiple_var_files/var8.tfvars | 0 .../multiple_var_files/var9.tfvars | 0 12 files changed, 37 insertions(+), 42 deletions(-) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/main.tf (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var1.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var2.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var3.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var4.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var5.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var6.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var7.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var8.tfvars (100%) rename tests/workflows/{test-plan => test-apply}/multiple_var_files/var9.tfvars (100%) diff --git a/.github/workflows/test-apply.yaml b/.github/workflows/test-apply.yaml index d3d4cfa3..1c35165e 100644 --- a/.github/workflows/test-apply.yaml +++ b/.github/workflows/test-apply.yaml @@ -1506,3 +1506,40 @@ jobs: echo "Apply did not fail correctly" exit 1 fi + + apply_multiple_var_files: + runs-on: ubuntu-24.04 + name: Apply with multiple var files + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + persist-credentials: false + + - name: Apply + uses: ./terraform-apply + id: apply + with: + auto_approve: true + path: tests/workflows/test-apply/multiple_var_files + var_file: | + tests/workflows/test-apply/multiple_var_files/var1.tfvars + tests/workflows/test-apply/multiple_var_files/var2.tfvars + tests/workflows/test-apply/multiple_var_files/var3.tfvars + tests/workflows/test-apply/multiple_var_files/var4.tfvars + tests/workflows/test-apply/multiple_var_files/var5.tfvars + tests/workflows/test-apply/multiple_var_files/var6.tfvars + tests/workflows/test-apply/multiple_var_files/var7.tfvars + tests/workflows/test-apply/multiple_var_files/var8.tfvars + tests/workflows/test-apply/multiple_var_files/var9.tfvars + variables: | + var_from_input = "ten" + + - name: Verify outputs + env: + ALL_VARS: ${{ steps.apply.outputs.all_vars }} + run: | + if [[ "$ALL_VARS" != "one-two-three-four-five-six-seven-eight-nine-ten" ]]; then + echo "Expected all_vars output to be 'one-two-three-four-five-six-seven-eight-nine-ten', got '$ALL_VARS'" + exit 1 + fi diff --git a/.github/workflows/test-plan.yaml b/.github/workflows/test-plan.yaml index 4f0f413c..e7e5c63b 100644 --- a/.github/workflows/test-plan.yaml +++ b/.github/workflows/test-plan.yaml @@ -887,48 +887,6 @@ jobs: variables: | my_sensitive_string = "password123" - plan_multiple_var_files: - runs-on: ubuntu-24.04 - name: Plan multiple var files - permissions: - contents: read - pull-requests: write - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - persist-credentials: false - - - name: Plan - uses: ./terraform-plan - id: plan - with: - add_github_comment: false - path: tests/workflows/test-plan/multiple_var_files - var_file: | - tests/workflows/test-plan/multiple_var_files/var1.tfvars - tests/workflows/test-plan/multiple_var_files/var2.tfvars - tests/workflows/test-plan/multiple_var_files/var3.tfvars - tests/workflows/test-plan/multiple_var_files/var4.tfvars - tests/workflows/test-plan/multiple_var_files/var5.tfvars - tests/workflows/test-plan/multiple_var_files/var6.tfvars - tests/workflows/test-plan/multiple_var_files/var7.tfvars - tests/workflows/test-plan/multiple_var_files/var8.tfvars - tests/workflows/test-plan/multiple_var_files/var9.tfvars - variables: | - var_from_input = "ten" - - - name: Verify outputs - env: - ALL_VARS: ${{ steps.plan.outputs.all_vars }} - run: | - if [[ "$ALL_VARS" != "one-two-three-four-five-six-seven-eight-nine-ten" ]]; then - echo "Expected all_vars output to be 'one-two-three-four-five-six-seven-eight-nine-ten', got '$ALL_VARS'" - exit 1 - fi - plan_sensitive_variables: runs-on: ubuntu-24.04 name: Plan variables some which are sensitive diff --git a/tests/workflows/test-plan/multiple_var_files/main.tf b/tests/workflows/test-apply/multiple_var_files/main.tf similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/main.tf rename to tests/workflows/test-apply/multiple_var_files/main.tf diff --git a/tests/workflows/test-plan/multiple_var_files/var1.tfvars b/tests/workflows/test-apply/multiple_var_files/var1.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var1.tfvars rename to tests/workflows/test-apply/multiple_var_files/var1.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var2.tfvars b/tests/workflows/test-apply/multiple_var_files/var2.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var2.tfvars rename to tests/workflows/test-apply/multiple_var_files/var2.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var3.tfvars b/tests/workflows/test-apply/multiple_var_files/var3.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var3.tfvars rename to tests/workflows/test-apply/multiple_var_files/var3.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var4.tfvars b/tests/workflows/test-apply/multiple_var_files/var4.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var4.tfvars rename to tests/workflows/test-apply/multiple_var_files/var4.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var5.tfvars b/tests/workflows/test-apply/multiple_var_files/var5.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var5.tfvars rename to tests/workflows/test-apply/multiple_var_files/var5.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var6.tfvars b/tests/workflows/test-apply/multiple_var_files/var6.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var6.tfvars rename to tests/workflows/test-apply/multiple_var_files/var6.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var7.tfvars b/tests/workflows/test-apply/multiple_var_files/var7.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var7.tfvars rename to tests/workflows/test-apply/multiple_var_files/var7.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var8.tfvars b/tests/workflows/test-apply/multiple_var_files/var8.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var8.tfvars rename to tests/workflows/test-apply/multiple_var_files/var8.tfvars diff --git a/tests/workflows/test-plan/multiple_var_files/var9.tfvars b/tests/workflows/test-apply/multiple_var_files/var9.tfvars similarity index 100% rename from tests/workflows/test-plan/multiple_var_files/var9.tfvars rename to tests/workflows/test-apply/multiple_var_files/var9.tfvars From e8be8d8f0b6d901ef15727c501797321e19840cf Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Tue, 13 Jan 2026 13:25:47 +0000 Subject: [PATCH 7/7] :bookmark: v2.2.3 --- CHANGELOG.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7af26a3b..81a68d7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,10 +11,16 @@ The actions are versioned as a suite. Some actions may have no change in behavio When using an action you can specify the version as: -- `@v2.2.2` to use an exact release +- `@v2.2.3` to use an exact release - `@v2.2` to use the latest patch release for the specific minor version - `@v2` to use the latest patch release for the specific major version +## [2.2.3] - 2026-01-13 + +### Fixed +- Fixed an issue where specifying more than 8 var files would cause the action to fail an error. + Thanks to [cdsre](https://github.com/cdsre) for reporting and fixing this issue. + ## [2.2.2] - 2025-08-08 ### Fixed @@ -797,6 +803,7 @@ First release of the GitHub Actions: - [dflook/terraform-new-workspace](terraform-new-workspace) - [dflook/terraform-destroy-workspace](terraform-destroy-workspace) +[2.2.3]: https://github.com/dflook/terraform-github-actions/compare/v2.2.2...v2.2.3 [2.2.2]: https://github.com/dflook/terraform-github-actions/compare/v2.2.1...v2.2.2 [2.2.1]: https://github.com/dflook/terraform-github-actions/compare/v2.2.0...v2.2.1 [2.2.0]: https://github.com/dflook/terraform-github-actions/compare/v2.1.0...v2.2.0