From 579faeb2fd1250ae60cc2cf61411900114a650e0 Mon Sep 17 00:00:00 2001 From: galargh Date: Mon, 8 Dec 2025 22:14:20 +0000 Subject: [PATCH] upgrade@20044563183 --- .github/workflows/sync.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 0cc681a..544fd1f 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -12,6 +12,10 @@ on: description: Whether to acquire terraform state lock during sync required: false default: "true" + refresh: + description: Refresh terraform state before sync + required: false + default: "false" jobs: prepare: @@ -77,6 +81,12 @@ jobs: terraform workspace select "${TF_WORKSPACE_OPT}" || terraform workspace new "${TF_WORKSPACE_OPT}" echo "TF_WORKSPACE=${TF_WORKSPACE_OPT}" >> $GITHUB_ENV working-directory: terraform + - name: Refresh terraform state + if: ${{ github.event.inputs.refresh == 'true' }} + run: | + echo "{}" > $TF_WORKSPACE.tfstate.json + terraform apply -refresh-only -auto-approve -lock=$TF_LOCK + working-directory: terraform - name: Pull terraform state run: | terraform show -json > $TF_WORKSPACE.tfstate.json