From acfff2c4fae5282536e27ec71bec511c825852ea Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 1 Nov 2023 11:20:43 +0530 Subject: [PATCH] indentation issue --- .github/workflows/render-preview-deploy.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/render-preview-deploy.yml b/.github/workflows/render-preview-deploy.yml index cb29c568c2..a91e66cca6 100644 --- a/.github/workflows/render-preview-deploy.yml +++ b/.github/workflows/render-preview-deploy.yml @@ -261,7 +261,12 @@ jobs: PGUSER: ${{ secrets.RENDER_DS_PG_USER }} PGDATABASE: ${{ env.PR_NUMBER }} run: | - PGPASSWORD=${{ secrets.RENDER_DS_PG_PASS }} psql -h $PGHOST -p $PGPORT -U $PGUSER -d postgres -c "drop database \"$PGDATABASE\" ;" + if PGPASSWORD=${{ secrets.RENDER_DS_PG_PASS }} psql -h $PGHOST -p $PGPORT -U $PGUSER -lqt | cut -d \| -f 1 | grep -qw $PGDATABASE; then + echo "Database $PGDATABASE exists, deleting..." + PGPASSWORD=${{ secrets.RENDER_DS_PG_PASS }} psql -h $PGHOST -p $PGPORT -U $PGUSER -d postgres -c "drop database \"$PGDATABASE\" ;" + else + echo "Database $PGDATABASE does not exist." + fi suspend-review-app: if: ${{ github.event.action == 'labeled' && github.event.label.name == 'suspend-review-app' }}