From 05aede8dd91b38ce39d5679ed566338a61b1e025 Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 1 Nov 2023 11:06:21 +0530 Subject: [PATCH 1/4] Fix destory render workflow --- .github/workflows/docs-pr-app.yml | 2 +- .github/workflows/render-preview-deploy.yml | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docs-pr-app.yml b/.github/workflows/docs-pr-app.yml index 5f0a28f7d8..0fd88a093b 100644 --- a/.github/workflows/docs-pr-app.yml +++ b/.github/workflows/docs-pr-app.yml @@ -1,4 +1,4 @@ -name: Render PR deploy +name: Render PR deploy Docs on: pull_request_target: types: [labeled, unlabeled, closed] diff --git a/.github/workflows/render-preview-deploy.yml b/.github/workflows/render-preview-deploy.yml index 4b92ba62b0..79e32fe25b 100644 --- a/.github/workflows/render-preview-deploy.yml +++ b/.github/workflows/render-preview-deploy.yml @@ -252,7 +252,7 @@ jobs: sudo apt install postgresql-client -y - name: Wait after installing PostgreSQL - run: sleep 25 + run: sleep 25 - name: Drop PostgreSQL PR database env: @@ -260,8 +260,13 @@ jobs: PGPORT: 5432 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\" ;" + run: | + 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' }} From c427e5b122570d63b2029f2e4e205230082d12ba Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 1 Nov 2023 11:14:20 +0530 Subject: [PATCH 2/4] indentation issue --- .github/workflows/render-preview-deploy.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/render-preview-deploy.yml b/.github/workflows/render-preview-deploy.yml index 79e32fe25b..3291733559 100644 --- a/.github/workflows/render-preview-deploy.yml +++ b/.github/workflows/render-preview-deploy.yml @@ -260,13 +260,13 @@ jobs: PGPORT: 5432 PGUSER: ${{ secrets.RENDER_DS_PG_USER }} PGDATABASE: ${{ env.PR_NUMBER }} - run: | - 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 + run: | + 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' }} From cb41047c3b5885ed70f5e3e5be1f153e0d253898 Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 1 Nov 2023 11:16:08 +0530 Subject: [PATCH 3/4] indentation issue --- .github/workflows/render-preview-deploy.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/render-preview-deploy.yml b/.github/workflows/render-preview-deploy.yml index 3291733559..cb29c568c2 100644 --- a/.github/workflows/render-preview-deploy.yml +++ b/.github/workflows/render-preview-deploy.yml @@ -261,12 +261,7 @@ jobs: PGUSER: ${{ secrets.RENDER_DS_PG_USER }} PGDATABASE: ${{ env.PR_NUMBER }} run: | - 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' }} From acfff2c4fae5282536e27ec71bec511c825852ea Mon Sep 17 00:00:00 2001 From: Adish M Date: Wed, 1 Nov 2023 11:20:43 +0530 Subject: [PATCH 4/4] 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' }}