Skip to content

Commit f8daa87

Browse files
authored
Merge pull request #417 from dflook/multiple_vars
Fix issue with >8 var files
2 parents 7a9d257 + e8be8d8 commit f8daa87

File tree

19 files changed

+115
-9
lines changed

19 files changed

+115
-9
lines changed

.github/actionlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ paths:
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'

.github/workflows/base-image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
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

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
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:

.github/workflows/test-apply.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/test-plan.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff 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

.github/workflows/test-version.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@ The actions are versioned as a suite. Some actions may have no change in behavio
1111

1212
When 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

image/actions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
variable "var1" {
2+
type = string
3+
default = ""
4+
}
5+
6+
variable "var2" {
7+
type = string
8+
default = ""
9+
}
10+
11+
variable "var3" {
12+
type = string
13+
default = ""
14+
}
15+
16+
variable "var4" {
17+
type = string
18+
default = ""
19+
}
20+
21+
variable "var5" {
22+
type = string
23+
default = ""
24+
}
25+
26+
variable "var6" {
27+
type = string
28+
default = ""
29+
}
30+
31+
variable "var7" {
32+
type = string
33+
default = ""
34+
}
35+
36+
variable "var8" {
37+
type = string
38+
default = ""
39+
}
40+
41+
variable "var9" {
42+
type = string
43+
default = ""
44+
}
45+
46+
variable "var_from_input" {
47+
type = string
48+
default = ""
49+
}
50+
51+
output "all_vars" {
52+
value = "${var.var1}-${var.var2}-${var.var3}-${var.var4}-${var.var5}-${var.var6}-${var.var7}-${var.var8}-${var.var9}-${var.var_from_input}"
53+
}

0 commit comments

Comments
 (0)