diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index c79d5ab318..9c4114d98c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -42,23 +42,24 @@ jobs: run: npx surge ./ --domain https://quarkiverse-docs-pr-${{ steps.pr.outputs.id }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} - name: Update PR status comment on success - uses: actions-cool/maintain-one-comment@v3 + uses: quarkusio/action-helpers@main with: - token: ${{ secrets.GITHUB_TOKEN }} + action: maintain-one-comment + github-token: ${{ secrets.GITHUB_TOKEN }} + pr-number: ${{ steps.pr.outputs.id }} body: | 🚀 PR Preview ${{ github.sha }} has been successfully built and deployed to https://quarkiverse-docs-pr-${{ steps.pr.outputs.id }}-preview.surge.sh - - body-include: '' - number: ${{ steps.pr.outputs.id }} + + body-marker: - name: Update PR status comment on failure + uses: quarkusio/action-helpers@main if: ${{ failure() }} - uses: actions-cool/maintain-one-comment@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + action: maintain-one-comment + github-token: ${{ secrets.GITHUB_TOKEN }} + pr-number: ${{ steps.pr.outputs.id }} body: | 😭 Deploy PR Preview failed. - - body-include: '' - number: ${{ steps.pr.outputs.id }} + body-marker: diff --git a/.github/workflows/preview_teardown.yml b/.github/workflows/preview_teardown.yml index f3a5da9a8a..f1be10a284 100644 --- a/.github/workflows/preview_teardown.yml +++ b/.github/workflows/preview_teardown.yml @@ -8,16 +8,18 @@ on: jobs: preview: runs-on: ubuntu-latest + permissions: + pull-requests: write # Required to update PR status comment steps: - name: Teardown surge preview id: deploy run: npx surge teardown https://quarkiverse-docs-pr-${{ github.event.number }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} || true - name: Update PR status comment - uses: actions-cool/maintain-one-comment@v3 + uses: quarkusio/action-helpers@main with: - token: ${{ secrets.GITHUB_TOKEN }} + action: maintain-one-comment + github-token: ${{ secrets.GITHUB_TOKEN }} + pr-number: ${{ github.event.number }} body: | 🙈 The PR is closed and the preview is expired. - - body-include: '' - number: ${{ github.event.number }} + body-marker: