Skip to content

Commit

Permalink
Merge pull request #2073 from gsmet/replace-maintain-one-comment
Browse files Browse the repository at this point in the history
Replace maintain-one-comment action with our own
  • Loading branch information
gsmet authored Aug 11, 2024
2 parents a738489 + 7f22b5d commit dcb267e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/preview-teardown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
id: deploy
run: npx surge teardown https://quarkus-site-pr-${{ github.event.number }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }} || echo "NOT_TORNDOWN=true" >> "$GITHUB_ENV"
- name: Update PR status comment
uses: actions-cool/[email protected]
uses: quarkusio/action-helpers@main
if: env.NOT_TORNDOWN != 'true'
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.
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ github.event.number }}
body-marker: <!-- Preview status comment marker -->
23 changes: 12 additions & 11 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ jobs:
runs-on: ubuntu-latest
permissions:
actions: read
# needed to maintain comments
issues: write
# 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:
Expand All @@ -37,28 +37,29 @@ jobs:
run: npx surge ./ --domain https://quarkus-site-pr-${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/[email protected]
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-site-pr-${{ steps.pr.outputs.id }}-preview.surge.sh
- Images of blog posts older than 3 months are not available.
- Newsletters older than 3 months are not available.
<img width="300" src="https://user-images.githubusercontent.com/507615/90250366-88233900-de6e-11ea-95a5-84f0762ffd39.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
body-marker: <!-- Preview status comment marker -->
- name: Update PR status comment on failure
uses: quarkusio/action-helpers@main
if: ${{ failure() }}
uses: actions-cool/[email protected]
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.
<img width="300" src="https://user-images.githubusercontent.com/507615/90250824-4e066700-de6f-11ea-8230-600ecc3d6a6b.png">
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
body-marker: <!-- Preview status comment marker -->

0 comments on commit dcb267e

Please sign in to comment.