From 3cea625f1a6ef992396659e4140374c3bb5de5ed Mon Sep 17 00:00:00 2001 From: galargh Date: Mon, 8 Dec 2025 22:14:15 +0000 Subject: [PATCH] upgrade@20044559528 --- .github/workflows/sync.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 86ad2ea..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,10 +81,14 @@ 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: Pull terraform state + - name: Refresh terraform state + if: ${{ github.event.inputs.refresh == 'true' }} run: | echo "{}" > $TF_WORKSPACE.tfstate.json - terraform refresh + terraform apply -refresh-only -auto-approve -lock=$TF_LOCK + working-directory: terraform + - name: Pull terraform state + run: | terraform show -json > $TF_WORKSPACE.tfstate.json working-directory: terraform - name: Install pnpm