fixup! Only try to upload updated tf state if it exists

Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
Daniel Weiße 2024-05-02 08:09:12 +02:00
parent 23af69c336
commit bbf0f92d59
No known key found for this signature in database
GPG Key ID: 7DD3015F3DDE4B9C

View File

@ -23,7 +23,7 @@ runs:
if: always() && inputs.skipDeletion == 'false'
shell: bash
run: |
if [ ! -d constellation-terraform ] && [ ! -d constellation-iam-terraform ]; then
if [[ ! -d constellation-terraform ]] && [[ ! -d constellation-iam-terraform ]]; then
echo "DELETE_TF_STATE=true" >> "$GITHUB_ENV"
else
echo "DELETE_TF_STATE=false" >> "$GITHUB_ENV"
@ -44,13 +44,13 @@ runs:
mkdir -p to-zip
to_upload=""
if [ -d constellation-terraform ]; then
if [[ -d constellation-terraform ]]; then
cp -r constellation-terraform to-zip
rm -f to-zip/constellation-terraform/plan.zip
rm -rf to-zip/constellation-terraform/.terraform
to_upload+="to-zip/constellation-terraform"
fi
if [ -d constellation-iam-terraform ]; then
if [[ -d constellation-iam-terraform ]]; then
cp -r constellation-iam-terraform to-zip
rm -rf to-zip/constellation-iam-terraform/.terraform
to_upload+=" to-zip/constellation-iam-terraform"