Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/actionlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/base-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test-apply.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 0 additions & 1 deletion .github/workflows/test-plan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion image/actions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
53 changes: 53 additions & 0 deletions tests/workflows/test-apply/multiple_var_files/main.tf
Original file line number Diff line number Diff line change
@@ -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}"
}
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var1.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var1 = "one"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var2.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var2 = "two"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var3.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var3 = "three"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var4.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var4 = "four"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var5.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var5 = "five"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var6.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var6 = "six"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var7.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var7 = "seven"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var8.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var8 = "eight"
1 change: 1 addition & 0 deletions tests/workflows/test-apply/multiple_var_files/var9.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
var9 = "nine"
Loading