Skip to content

Commit bdba707

Browse files
committed
Make sure tfvars files are loaded in the correct order
They are read in lexical order by terraform, use a two digit counter to ensure this is correct even for >10 files.
1 parent 05e863a commit bdba707

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

image/actions.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ function set-plan-args() {
389389
}
390390

391391
function create-auto-tfvars() {
392-
local AUTO_TFVARS_COUNTER=0
392+
local AUTO_TFVARS_COUNTER="00"
393393

394394
if [[ -n "${INPUT_VAR_FILE:-}" ]]; then
395395
for file_path in $(echo "$INPUT_VAR_FILE" | tr ',' '\n'); do
@@ -403,7 +403,7 @@ function create-auto-tfvars() {
403403

404404
debug_log "Creating autoloading tfvars file for $file_path: zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars"
405405
cp "$file_path" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars"
406-
AUTO_TFVARS_COUNTER=$((AUTO_TFVARS_COUNTER + 1))
406+
AUTO_TFVARS_COUNTER=$(printf "%02d\n" "$((AUTO_TFVARS_COUNTER + 1))")
407407
done
408408
fi
409409

0 commit comments

Comments
 (0)