Skip to content

Commit

Permalink
Add comment to PR with preview link
Browse files Browse the repository at this point in the history
  • Loading branch information
holly-cummins committed May 17, 2023
1 parent 2636e21 commit 873cd26
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,27 @@ jobs:
- name: Get the preview_url
run: echo "url => ${{ steps.preview_step.outputs.preview_url }}"
- name: Store PR id as variable
id: pr
run: |
echo "id=$(<pr-id.txt)" >> $GITHUB_OUTPUT
rm -f pr-id.txt
- name: Update PR status comment on success
uses: actions-cool/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
📖 PR Preview ${{ github.sha }} has been successfully built and deployed to https://${{ steps.preview_step.outputs.preview_url }}
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}
- name: Update PR status comment on failure
if: ${{ failure() }}
uses: actions-cool/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
📓 💔 Deploy PR Preview failed.
<!-- Sticky Pull Request Comment -->
body-include: '<!-- Sticky Pull Request Comment -->'
number: ${{ steps.pr.outputs.id }}

0 comments on commit 873cd26

Please sign in to comment.