From 42c2e3106b43a9aa815cb6a1cd951720c4609255 Mon Sep 17 00:00:00 2001 From: Ricardo Zanini <1538000+ricardozanini@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:54:36 -0300 Subject: [PATCH] Add PR id to publish workflows (#564) Signed-off-by: Ricardo Zanini --- .github/workflows/pr-preview-publish.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-preview-publish.yml b/.github/workflows/pr-preview-publish.yml index cb4602fb1..45dc4b168 100644 --- a/.github/workflows/pr-preview-publish.yml +++ b/.github/workflows/pr-preview-publish.yml @@ -41,7 +41,7 @@ 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() @@ -49,10 +49,10 @@ jobs: 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 body-include: "" - number: ${{ github.event.number }} + number: ${{ github.event.workflow_run.pull_requests[0].number }} emojis: "heart" - name: Update PR status comment on failure @@ -65,5 +65,5 @@ jobs: body-include: "" - number: ${{ github.event.number }} + number: ${{ github.event.workflow_run.pull_requests[0].number }} emojis: "confused"