From db0b080f5bfea0d5a6de83070a673fa65b36e380 Mon Sep 17 00:00:00 2001 From: Andromachi Rozaki Date: Wed, 24 Jul 2024 12:10:55 +0200 Subject: [PATCH] try out new action --- .github/workflows/preview-env-deploy.yml | 3 +++ .github/workflows/preview-env-teardown.yml | 31 +++++++++------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/.github/workflows/preview-env-deploy.yml b/.github/workflows/preview-env-deploy.yml index 30750db8ac7..759b14d7312 100644 --- a/.github/workflows/preview-env-deploy.yml +++ b/.github/workflows/preview-env-deploy.yml @@ -33,6 +33,7 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} message-id: mymessageid + refresh-message-position: true message: | :construction: The preview environment for the commit ${{ github.sha }} is being built. This usually takes 15-20 minutes. @@ -70,6 +71,7 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} message-id: mymessageid + refresh-message-position: true message: | :arrow_up: The preview environment build results for commit ${{ github.sha }} are being uploaded. This usually takes 3-4 minutes. @@ -95,5 +97,6 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} message-id: mymessageid + refresh-message-position: true message: | The preview environment relating to the commit ${{ github.sha }} has successfully been deployed. You can access it at [https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html](https://${{ env.BUCKET_NAME }}/pr-${{ github.event.number }}/index.html) diff --git a/.github/workflows/preview-env-teardown.yml b/.github/workflows/preview-env-teardown.yml index 900f92815d0..fdf0cb079de 100644 --- a/.github/workflows/preview-env-teardown.yml +++ b/.github/workflows/preview-env-teardown.yml @@ -29,21 +29,14 @@ jobs: with: credentials_json: ${{ steps.secrets.outputs.PREVIEW_ENV_GCLOUD_SA_KEY }} - - name: Find deployment status comment - uses: peter-evans/find-comment@v3 - id: find-comment + - name: Add or Update Comment - Build Status + uses: mshick/add-pr-comment@v2 with: - issue-number: ${{ github.event.number }} - body-includes: - - - name: Update comment with tear-down warning - if: steps.find-comment.outputs.comment-id != '' - uses: peter-evans/create-or-update-comment@v4 - with: - comment-id: ${{ steps.find-comment.outputs.comment-id }} - body: | + repo-token: ${{ secrets.GITHUB_TOKEN }} + message-id: mymessageid + refresh-message-position: true + message: | :warning: Preview environment for commit ${{ github.sha }} is being deleted. This usually takes 2-3 minutes. - edit-mode: replace - name: Set up Cloud SDK uses: google-github-actions/setup-gcloud@v2 @@ -63,11 +56,11 @@ jobs: env: ${{ github.event.repository.name }} ref: ${{ github.event.pull_request.head.sha }} - - name: Update comment with tear-down status - if: steps.find-comment.outputs.comment-id != '' - uses: peter-evans/create-or-update-comment@v4 + - name: Add or Update Comment - Build Status + uses: mshick/add-pr-comment@v2 with: - comment-id: ${{ steps.find-comment.outputs.comment-id }} - body: | + repo-token: ${{ secrets.GITHUB_TOKEN }} + message-id: mymessageid + refresh-message-position: true + message: | :broom: Preview environment for this PR has been torn down. - edit-mode: replace