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"