diff --git a/.github/workflows/preview-teardown.yml b/.github/workflows/preview-teardown.yml index 02cbc42b22df2..4b36ebfc30b89 100644 --- a/.github/workflows/preview-teardown.yml +++ b/.github/workflows/preview-teardown.yml @@ -15,11 +15,11 @@ jobs: id: deploy run: npx surge teardown https://quarkus-pr-main-${{ github.event.number }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} || true - name: Update PR status comment - uses: actions-cool/maintain-one-comment@v3.2.0 + 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 }} \ No newline at end of file + body-marker: diff --git a/.github/workflows/preview.yml b/.github/workflows/preview.yml index 4c01c17c05bed..4272c55f44f1c 100644 --- a/.github/workflows/preview.yml +++ b/.github/workflows/preview.yml @@ -15,9 +15,9 @@ jobs: runs-on: ubuntu-latest permissions: actions: read - # this should be enough to maintain comments as commenting on pull requests is done through an issues API issues: write - pull-requests: read + # this is unfortunately needed to be able to write comments on pull requests + pull-requests: write if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success' steps: - uses: actions/checkout@v4 @@ -115,13 +115,16 @@ jobs: - name: Publishing to surge for preview id: deploy - run: npx surge ./_site --domain https://quarkus-pr-main-${PR_ID}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} + run: npx surge@0.23.1 ./_site --domain https://quarkus-pr-main-${PR_ID}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} env: PR_ID: ${{ steps.pr.outputs.id }} + - name: Update PR status comment on success - uses: actions-cool/maintain-one-comment@v3.2.0 + 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://quarkus-pr-main-${{ steps.pr.outputs.id }}-preview.surge.sh/version/main/guides/ @@ -129,17 +132,15 @@ jobs: - Newsletters older than 3 months are not available. - - 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.2.0 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: