From bbf0f92d59da1ad22f8be276658c8c20a16d0b92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Thu, 2 May 2024 08:09:12 +0200 Subject: [PATCH] fixup! Only try to upload updated tf state if it exists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- .github/actions/update_tfstate/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/update_tfstate/action.yml b/.github/actions/update_tfstate/action.yml index 4bbdf8ec3..276748546 100644 --- a/.github/actions/update_tfstate/action.yml +++ b/.github/actions/update_tfstate/action.yml @@ -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"