@@ -17,31 +17,32 @@ jobs:
1717 permissions :
1818 pull-requests : write # Required to update PR status comment
1919 steps :
20- - name : Dump GitHub context
21- env :
22- GITHUB_CONTEXT : ${{ toJson(github) }}
23- run : echo "$GITHUB_CONTEXT"
24-
2520 - name : Download blog artifact
2621 uses : actions/download-artifact@v4
2722 with :
2823 name : blog
2924 github-token : ${{ secrets.GITHUB_TOKEN }}
3025 run-id : ${{ github.event.workflow_run.id }}
3126
27+ - name : Retrieve PR id
28+ id : pr
29+ run : |
30+ echo "id=$(<.pr-id)" >> $GITHUB_OUTPUT
31+ rm -f .pr-id
32+
3233 - name : Publishing blog to gh-pages
3334 id : deploy-blog
34- run : npx surge ./ --domain https://netobserv-io-blog-${{ github.event.workflow_run.pull_requests[0].number }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }}
35+ run : npx surge ./ --domain https://netobserv-io-blog-${{ steps.pr.outputs.id }}-preview.surge.sh --token ${{ secrets.SURGE_TOKEN }}
3536
3637 - name : Update PR status comment on success
3738 uses : quarkusio/action-helpers@main
3839 with :
3940 action : maintain-one-comment
4041 github-token : ${{ secrets.GITHUB_TOKEN }}
41- pr-number : ${{ github.event.workflow_run.pull_requests[0].number }}
42+ pr-number : ${{ steps.pr.outputs.id }}
4243 body : |
4344 🚀 PR Preview for **blog** ${{ github.sha }} has been successfully built!
44- * https://netobserv-io-blog-${{ github.event.workflow_run.pull_requests[0].number }}-preview.surge.sh
45+ * https://netobserv-io-blog-${{ steps.pr.outputs.id }}-preview.surge.sh
4546 body-marker : <!-- Preview status comment marker -->
4647
4748 - name : Update PR status comment on failure
5051 with :
5152 action : maintain-one-comment
5253 github-token : ${{ secrets.GITHUB_TOKEN }}
53- pr-number : ${{ github.event.workflow_run.pull_requests[0].number }}
54+ pr-number : ${{ steps.pr.outputs.id }}
5455 body : |
5556 😭 Deploy PR Preview failed.
5657 body-marker : <!-- Preview status comment marker -->
0 commit comments