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/.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-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 d539efa6..e7e5c63b 100644 --- a/.github/workflows/test-plan.yaml +++ b/.github/workflows/test-plan.yaml @@ -887,7 +887,6 @@ jobs: variables: | my_sensitive_string = "password123" - plan_sensitive_variables: runs-on: ubuntu-24.04 name: Plan variables some which are sensitive 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 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 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 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 diff --git a/tests/workflows/test-apply/multiple_var_files/main.tf b/tests/workflows/test-apply/multiple_var_files/main.tf new file mode 100644 index 00000000..fe931f9c --- /dev/null +++ b/tests/workflows/test-apply/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}" +} diff --git a/tests/workflows/test-apply/multiple_var_files/var1.tfvars b/tests/workflows/test-apply/multiple_var_files/var1.tfvars new file mode 100644 index 00000000..299ffe91 --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var1.tfvars @@ -0,0 +1 @@ +var1 = "one" diff --git a/tests/workflows/test-apply/multiple_var_files/var2.tfvars b/tests/workflows/test-apply/multiple_var_files/var2.tfvars new file mode 100644 index 00000000..2657f340 --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var2.tfvars @@ -0,0 +1 @@ +var2 = "two" diff --git a/tests/workflows/test-apply/multiple_var_files/var3.tfvars b/tests/workflows/test-apply/multiple_var_files/var3.tfvars new file mode 100644 index 00000000..64111e0c --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var3.tfvars @@ -0,0 +1 @@ +var3 = "three" diff --git a/tests/workflows/test-apply/multiple_var_files/var4.tfvars b/tests/workflows/test-apply/multiple_var_files/var4.tfvars new file mode 100644 index 00000000..ae5de9c5 --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var4.tfvars @@ -0,0 +1 @@ +var4 = "four" diff --git a/tests/workflows/test-apply/multiple_var_files/var5.tfvars b/tests/workflows/test-apply/multiple_var_files/var5.tfvars new file mode 100644 index 00000000..fbb4e7af --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var5.tfvars @@ -0,0 +1 @@ +var5 = "five" diff --git a/tests/workflows/test-apply/multiple_var_files/var6.tfvars b/tests/workflows/test-apply/multiple_var_files/var6.tfvars new file mode 100644 index 00000000..ece1efef --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var6.tfvars @@ -0,0 +1 @@ +var6 = "six" diff --git a/tests/workflows/test-apply/multiple_var_files/var7.tfvars b/tests/workflows/test-apply/multiple_var_files/var7.tfvars new file mode 100644 index 00000000..d6e1dd88 --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var7.tfvars @@ -0,0 +1 @@ +var7 = "seven" diff --git a/tests/workflows/test-apply/multiple_var_files/var8.tfvars b/tests/workflows/test-apply/multiple_var_files/var8.tfvars new file mode 100644 index 00000000..f6ab2d9a --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var8.tfvars @@ -0,0 +1 @@ +var8 = "eight" diff --git a/tests/workflows/test-apply/multiple_var_files/var9.tfvars b/tests/workflows/test-apply/multiple_var_files/var9.tfvars new file mode 100644 index 00000000..b18270ef --- /dev/null +++ b/tests/workflows/test-apply/multiple_var_files/var9.tfvars @@ -0,0 +1 @@ +var9 = "nine"