Skip to content

Commit

Permalink
Add PR id to publish workflows (#564)
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Zanini <[email protected]>
  • Loading branch information
ricardozanini authored Mar 7, 2024
1 parent caf86c8 commit 42c2e31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr-preview-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ jobs:

- name: Publish to Surge for preview
id: deploy
run: npx surge ./build/site --domain https://sonataflow-docs-preview-pr-${{ github.event.number }}.surge.sh --token ${{ secrets.SURGE_LOCAL_TOKEN }}
run: npx surge ./build/site --domain https://sonataflow-docs-preview-pr-${{ github.event.workflow_run.pull_requests[0].number }}.surge.sh --token ${{ secrets.SURGE_LOCAL_TOKEN }}

- name: Update PR status comment on success
if: success()
uses: actions-cool/maintain-one-comment@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
🎊 PR Preview ${{ github.sha }} has been successfully built and deployed. See the documentation preview: https://sonataflow-docs-preview-pr-${{ github.event.number }}.surge.sh
🎊 PR Preview ${{ github.sha }} has been successfully built and deployed. See the documentation preview: https://sonataflow-docs-preview-pr-${{ github.event.workflow_run.pull_requests[0].number }}.surge.sh
<!-- Sticky Pull Request Comment -->
body-include: "<!-- Sticky Pull Request Comment -->"
number: ${{ github.event.number }}
number: ${{ github.event.workflow_run.pull_requests[0].number }}
emojis: "heart"

- name: Update PR status comment on failure
Expand All @@ -65,5 +65,5 @@ jobs:
<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: ${{ github.event.number }}
number: ${{ github.event.workflow_run.pull_requests[0].number }}
emojis: "confused"

0 comments on commit 42c2e31

Please sign in to comment.