Skip to content

Commit a01576e

Browse files
authored
Merge pull request #136 from multiformats/master-upgrade
upgrade@20044563183
2 parents 9147c98 + 579faeb commit a01576e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/sync.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ on:
1212
description: Whether to acquire terraform state lock during sync
1313
required: false
1414
default: "true"
15+
refresh:
16+
description: Refresh terraform state before sync
17+
required: false
18+
default: "false"
1519

1620
jobs:
1721
prepare:
@@ -77,6 +81,12 @@ jobs:
7781
terraform workspace select "${TF_WORKSPACE_OPT}" || terraform workspace new "${TF_WORKSPACE_OPT}"
7882
echo "TF_WORKSPACE=${TF_WORKSPACE_OPT}" >> $GITHUB_ENV
7983
working-directory: terraform
84+
- name: Refresh terraform state
85+
if: ${{ github.event.inputs.refresh == 'true' }}
86+
run: |
87+
echo "{}" > $TF_WORKSPACE.tfstate.json
88+
terraform apply -refresh-only -auto-approve -lock=$TF_LOCK
89+
working-directory: terraform
8090
- name: Pull terraform state
8191
run: |
8292
terraform show -json > $TF_WORKSPACE.tfstate.json

0 commit comments

Comments
 (0)