From 6c4e0c545a5daab4d58fa69a6a3e58f9b1ba3dc0 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Fri, 30 May 2025 13:58:57 +0100 Subject: [PATCH 1/3] Create auto var files as symlinks --- image/actions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/image/actions.sh b/image/actions.sh index c044afa0..7c21a72b 100644 --- a/image/actions.sh +++ b/image/actions.sh @@ -402,14 +402,15 @@ function create-auto-tfvars() { local name="${file_name%.tfvars}" debug_log "Creating autoloading tfvars file for $file_path: zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" - cp "$file_path" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" + ln -s "$file_path" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" AUTO_TFVARS_COUNTER=$(printf "%02d\n" "$((AUTO_TFVARS_COUNTER + 1))") done fi if [[ -n "${INPUT_VARIABLES:-}" ]]; then debug_log "Creating autoloading tfvars file for the variables input: zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.auto.tfvars" - echo "$INPUT_VARIABLES" >"$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.auto.tfvars" + echo "$INPUT_VARIABLES" >"$STEP_TMP_DIR/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.auto.tfvars" + ln -s "$STEP_TMP_DIR/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.auto.tfvars" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.auto.tfvars" fi } From 94a96072ffec53e20f436c9ac8c9a83277c4356d Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Sat, 31 May 2025 10:50:47 +0100 Subject: [PATCH 2/3] Create auto var files as symlinks --- image/actions.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/image/actions.sh b/image/actions.sh index 7c21a72b..4f2828ac 100644 --- a/image/actions.sh +++ b/image/actions.sh @@ -150,6 +150,8 @@ function setup() { detect-tfmask execute_run_commands + + create-auto-tfvars } function relative_to() { @@ -181,8 +183,6 @@ function set-init-args() { INIT_ARGS="$INIT_ARGS -backend-config=$config" done fi - - create-auto-tfvars } ## @@ -403,6 +403,7 @@ function create-auto-tfvars() { debug_log "Creating autoloading tfvars file for $file_path: zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" ln -s "$file_path" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" + debug_cmd ls -la "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" AUTO_TFVARS_COUNTER=$(printf "%02d\n" "$((AUTO_TFVARS_COUNTER + 1))") done fi From 740341619253e20bddd603b650110add0fa66808 Mon Sep 17 00:00:00 2001 From: Daniel Flook Date: Sat, 31 May 2025 11:05:38 +0100 Subject: [PATCH 3/3] Create auto var files as symlinks --- image/actions.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/image/actions.sh b/image/actions.sh index 4f2828ac..c193eeb8 100644 --- a/image/actions.sh +++ b/image/actions.sh @@ -402,8 +402,7 @@ function create-auto-tfvars() { local name="${file_name%.tfvars}" debug_log "Creating autoloading tfvars file for $file_path: zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" - ln -s "$file_path" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" - debug_cmd ls -la "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" + cp "$file_path" "$INPUT_PATH/zzzz-dflook-terraform-github-actions-$AUTO_TFVARS_COUNTER.$name.auto.tfvars" AUTO_TFVARS_COUNTER=$(printf "%02d\n" "$((AUTO_TFVARS_COUNTER + 1))") done fi