diff --git a/.github/actions/update_tfstate/action.yml b/.github/actions/update_tfstate/action.yml index e135d1cb651..5582ea9e564 100644 --- a/.github/actions/update_tfstate/action.yml +++ b/.github/actions/update_tfstate/action.yml @@ -11,12 +11,15 @@ inputs: encryptionSecret: description: "The encryption secret for the artifacts." required: true + skipDeletion: + description: "Don't try to delete the artifact before updating. You should only use this if you know that no artifact exists." + default: false runs: using: "composite" steps: - name: Check if tfstate should be deleted - if: always() + if: always() && !${{ inputs.skipDeletion }} shell: bash run: | if [ ! -d constellation-terraform ] && [ ! -d constellation-iam-terraform ]; then @@ -26,7 +29,7 @@ runs: fi - name: Delete tfstate artifact if necessary - if: always() && env.DELETE_TF_STATE == 'true' + if: always() && env.DELETE_TF_STATE == 'true' && !${{ inputs.skipDeletion }} uses: ./.github/actions/artifact_delete with: name: ${{ inputs.name }}