From 3dbca947ede01fe4d13411d3d2e60670a4b68499 Mon Sep 17 00:00:00 2001 From: "Stefan M." Date: Fri, 15 Nov 2024 07:28:34 +0100 Subject: [PATCH 1/3] Fix delete preview comment domain --- .github/workflows/preview-cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/preview-cleanup.yml b/.github/workflows/preview-cleanup.yml index 875ff0e..96a5882 100644 --- a/.github/workflows/preview-cleanup.yml +++ b/.github/workflows/preview-cleanup.yml @@ -33,4 +33,4 @@ jobs: number: ${{ github.event.number }} id: deploy-preview message: > - 🪓 PR closed, deleted preview at https://github.com/${{ env.PREVIEW_REPO }}/tree/gh-pages/${{ env.PPREVIEW_PATH }}/ + 🪓 PR closed, deleted preview at https://${{ env.PREVIEW_DOMAIN}}/${{ env.PREVIEW_REPO }}/tree/gh-pages/${{ env.PPREVIEW_PATH }}/ From 711241afb373f4172e8d5f50abe20aa34f724f45 Mon Sep 17 00:00:00 2001 From: "Stefan M." Date: Sun, 17 Nov 2024 13:43:24 +0100 Subject: [PATCH 2/3] Update preview-cleanup.yml --- .github/workflows/preview-cleanup.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/preview-cleanup.yml b/.github/workflows/preview-cleanup.yml index 96a5882..0352fb0 100644 --- a/.github/workflows/preview-cleanup.yml +++ b/.github/workflows/preview-cleanup.yml @@ -27,10 +27,22 @@ jobs: - name: Comment on PR uses: hasura/comment-progress@v2.2.0 + if: github.event.pull_request.merged == true with: github-token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} number: ${{ github.event.number }} id: deploy-preview message: > - 🪓 PR closed, deleted preview at https://${{ env.PREVIEW_DOMAIN}}/${{ env.PREVIEW_REPO }}/tree/gh-pages/${{ env.PPREVIEW_PATH }}/ + 🪓 PR merged, preview deleted ✅ Enjoy the updated content at https://community.gradle.org/ + + - name: Comment on PR + uses: hasura/comment-progress@v2.2.0 + if: github.event.pull_request.merged == false + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + repository: ${{ github.repository }} + number: ${{ github.event.number }} + id: deploy-preview + message: > + 🪓 PR closed, preview deleted ✅ From a0542f9570ade51d61cfa385cf72797608284e5a Mon Sep 17 00:00:00 2001 From: "Stefan M." Date: Sun, 17 Nov 2024 13:44:20 +0100 Subject: [PATCH 3/3] Remove id --- .github/workflows/preview-cleanup.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/preview-cleanup.yml b/.github/workflows/preview-cleanup.yml index 0352fb0..14228ba 100644 --- a/.github/workflows/preview-cleanup.yml +++ b/.github/workflows/preview-cleanup.yml @@ -32,7 +32,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} number: ${{ github.event.number }} - id: deploy-preview message: > 🪓 PR merged, preview deleted ✅ Enjoy the updated content at https://community.gradle.org/ @@ -43,6 +42,5 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} number: ${{ github.event.number }} - id: deploy-preview message: > 🪓 PR closed, preview deleted ✅