File tree Expand file tree Collapse file tree
tests/workflows/test-apply/multiple_var_files Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030 - ' property "git_https" is not defined in object type'
3131 - ' property "awkward_.*" is not defined in object type'
3232 - ' property "word" is not defined in object type'
33+ - ' property "all_vars" is not defined in object type'
3334 .github/workflows/test-target-replace-exclude.yaml :
3435 ignore :
3536 - ' property "count" is not defined in object type'
Original file line number Diff line number Diff line change 3636 echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin
3737
3838 - name : Set up Docker Buildx
39- uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
39+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
4040
4141 - name : Base image
4242 id : build-and-push
Original file line number Diff line number Diff line change @@ -3,36 +3,43 @@ name: Test pull_request_target event
33on :
44 - pull_request_target # zizmor: ignore[dangerous-triggers]
55
6- permissions :
7- contents : read
6+ permissions : {}
87
98jobs :
109 apply :
1110 runs-on : ubuntu-24.04
1211 name : Apply approved changes on pull_request_target
12+ if : github.repository == 'dflook/terraform-github-actions' && github.event.pull_request.head.repo.full_name == github.repository
1313 permissions :
14- contents : read
1514 pull-requests : write
1615 env :
1716 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
1817 steps :
19- - name : Checkout
20- uses : actions/checkout@v4
21- with :
22- persist-credentials : false
18+ - name : Create test module
19+ run : |
20+ mkdir -p test-module
21+ cat > test-module/main.tf << 'EOF'
22+ resource "random_string" "my_string" {
23+ length = 11
24+ }
25+
26+ output "output_string" {
27+ value = "the_string"
28+ }
29+ EOF
2330
2431 - name : Plan
25- uses : . /terraform-plan
32+ uses : dflook /terraform-plan@v1
2633 with :
2734 label : pull_request_target
28- path : tests/workflows/pull_request_target
35+ path : test-module
2936
3037 - name : Apply
31- uses : . /terraform-apply
38+ uses : dflook /terraform-apply@v1
3239 id : output
3340 with :
3441 label : pull_request_target
35- path : tests/workflows/pull_request_target
42+ path : test-module
3643
3744 - name : Verify outputs
3845 env :
Original file line number Diff line number Diff line change 4343 echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin
4444
4545 - name : Set up Docker Buildx
46- uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
46+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
4747
4848 - name : Build action image
4949 id : image_build
@@ -206,7 +206,7 @@ jobs:
206206 echo "$DOCKER_TOKEN" | docker login --username danielflook --password-stdin
207207
208208 - name : Set up Docker Buildx
209- uses : docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
209+ uses : docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
210210
211211 - name : Tag and push base image with release version
212212 env :
Original file line number Diff line number Diff line change @@ -1506,3 +1506,40 @@ jobs:
15061506 echo "Apply did not fail correctly"
15071507 exit 1
15081508 fi
1509+
1510+ apply_multiple_var_files :
1511+ runs-on : ubuntu-24.04
1512+ name : Apply with multiple var files
1513+ steps :
1514+ - name : Checkout
1515+ uses : actions/checkout@v4
1516+ with :
1517+ persist-credentials : false
1518+
1519+ - name : Apply
1520+ uses : ./terraform-apply
1521+ id : apply
1522+ with :
1523+ auto_approve : true
1524+ path : tests/workflows/test-apply/multiple_var_files
1525+ var_file : |
1526+ tests/workflows/test-apply/multiple_var_files/var1.tfvars
1527+ tests/workflows/test-apply/multiple_var_files/var2.tfvars
1528+ tests/workflows/test-apply/multiple_var_files/var3.tfvars
1529+ tests/workflows/test-apply/multiple_var_files/var4.tfvars
1530+ tests/workflows/test-apply/multiple_var_files/var5.tfvars
1531+ tests/workflows/test-apply/multiple_var_files/var6.tfvars
1532+ tests/workflows/test-apply/multiple_var_files/var7.tfvars
1533+ tests/workflows/test-apply/multiple_var_files/var8.tfvars
1534+ tests/workflows/test-apply/multiple_var_files/var9.tfvars
1535+ variables : |
1536+ var_from_input = "ten"
1537+
1538+ - name : Verify outputs
1539+ env :
1540+ ALL_VARS : ${{ steps.apply.outputs.all_vars }}
1541+ run : |
1542+ if [[ "$ALL_VARS" != "one-two-three-four-five-six-seven-eight-nine-ten" ]]; then
1543+ echo "Expected all_vars output to be 'one-two-three-four-five-six-seven-eight-nine-ten', got '$ALL_VARS'"
1544+ exit 1
1545+ fi
Original file line number Diff line number Diff line change @@ -887,7 +887,6 @@ jobs:
887887 variables : |
888888 my_sensitive_string = "password123"
889889
890-
891890 plan_sensitive_variables :
892891 runs-on : ubuntu-24.04
893892 name : Plan variables some which are sensitive
Original file line number Diff line number Diff line change @@ -611,7 +611,7 @@ jobs:
611611 run : |
612612 echo "The terraform version was $DETECTED_TERRAFORM_VERSION"
613613
614- if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.12 "* ]]; then
614+ if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.14 "* ]]; then
615615 echo "::error:: Latest version was not used"
616616 exit 1
617617 fi
@@ -632,7 +632,7 @@ jobs:
632632 run : |
633633 echo "The terraform version was $DETECTED_TERRAFORM_VERSION"
634634
635- if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.12 "* ]]; then
635+ if [[ "$DETECTED_TERRAFORM_VERSION" != *"1.14 "* ]]; then
636636 echo "::error:: Latest version was not used"
637637 exit 1
638638 fi
Original file line number Diff line number Diff line change @@ -142,6 +142,6 @@ jobs:
142142
143143 V8R_CONFIG_FILE=.config/.v8rrc.yaml npx v8r --ignore-errors
144144
145- - uses : astral-sh/ruff-action@9828f49eb4cadf267b40eaa330295c412c68c1f9 # v3
145+ - uses : astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
146146 with :
147147 args : --config=.config/ruff.toml check
Original file line number Diff line number Diff line change @@ -11,10 +11,16 @@ The actions are versioned as a suite. Some actions may have no change in behavio
1111
1212When using an action you can specify the version as:
1313
14- - ` @v2.2.2 ` to use an exact release
14+ - ` @v2.2.3 ` to use an exact release
1515- ` @v2.2 ` to use the latest patch release for the specific minor version
1616- ` @v2 ` to use the latest patch release for the specific major version
1717
18+ ## [ 2.2.3] - 2026-01-13
19+
20+ ### Fixed
21+ - Fixed an issue where specifying more than 8 var files would cause the action to fail an error.
22+ Thanks to [ cdsre] ( https://github.com/cdsre ) for reporting and fixing this issue.
23+
1824## [ 2.2.2] - 2025-08-08
1925
2026### Fixed
@@ -797,6 +803,7 @@ First release of the GitHub Actions:
797803- [dflook/terraform-new-workspace](terraform-new-workspace)
798804- [dflook/terraform-destroy-workspace](terraform-destroy-workspace)
799805
806+ [2.2.3] : https://github.com/dflook/terraform-github-actions/compare/v2.2.2...v2.2.3
800807[2.2.2] : https://github.com/dflook/terraform-github-actions/compare/v2.2.1...v2.2.2
801808[2.2.1] : https://github.com/dflook/terraform-github-actions/compare/v2.2.0...v2.2.1
802809[2.2.0] : https://github.com/dflook/terraform-github-actions/compare/v2.1.0...v2.2.0
Original file line number Diff line number Diff line change @@ -423,7 +423,7 @@ function create-auto-tfvars() {
423423
424424 debug_log " Creating autoloading tfvars file for $file_path : $link_name "
425425 cp " $file_path " " $INPUT_PATH /$link_name "
426- AUTO_TFVARS_COUNTER=$( printf " %02d\n" " $(( AUTO_TFVARS_COUNTER + 1 )) " )
426+ AUTO_TFVARS_COUNTER=$( printf " %02d\n" " $(( 10 # ${ AUTO_TFVARS_COUNTER} + 1 )) " )
427427 done
428428 fi
429429
You can’t perform that action at this time.
0 commit comments