Skip to content

Commit

Permalink
add option to skip deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
miampf committed Apr 19, 2024
1 parent b68431c commit ad59b7e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .github/actions/update_tfstate/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 }}
Expand Down

0 comments on commit ad59b7e

Please sign in to comment.