conditionally delete artifact

This commit is contained in:
miampf 2024-03-25 14:50:34 +01:00
parent f26c6c627a
commit 36d05cd677
No known key found for this signature in database
GPG Key ID: EF039364B5B6886C

View File

@ -200,6 +200,7 @@ jobs:
checks: write
contents: read
packages: write
actions: write
needs: [find-latest-image, generate-input-parameters]
if: always() && !cancelled()
steps:
@ -279,6 +280,23 @@ jobs:
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
gcpServiceAccount: "iam-e2e@constellation-e2e.iam.gserviceaccount.com"
- name: Check if tfstate should be deleted
if: always()
shell: bash
run: |
if [ ! -d constellation-terraform ] && [ ! -d constellation-iam-terraform]; then
echo "DELETE_TF_STATE=true" >> "$GITHUB_ENV"
else
echo "DELETE_TF_STATE=false" >> "$GITHUB_ENV"
fi
- name: Delete tfstate artifact
if: env.DELETE_TF_STATE == 'true'
uses: ./.github/actions/artifact_delete
with:
name: terraform-state-${{ steps.e2e_test.outputs.namePrefix }}
workflowID: ${{ github.run_id }}
- name: Prepare terraform state folders
if: always()
shell: bash