Skip to content

Commit

Permalink
Add PR number to environment for debugging workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
thornbill committed Aug 5, 2024
1 parent da2d825 commit debdf2d
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,17 @@ jobs:
&& github.event.workflow_run.head_branch
|| format('{0}/{1}', github.event.workflow_run.head_repository.full_name, github.event.workflow_run.head_branch)
}}
PR_NUMBER: |
${{
github.event.workflow_run.event == 'pull_request'
&& github.event.workflow_run.pull_requests[0] != null
&& github.event.workflow_run.pull_requests[0].number
|| ''
}}
outputs:
url: ${{ steps.cf.outputs.url }}
branch: ${{ env.TARGET_BRANCH }}
pr_number: ${{ env.PR_NUMBER }}

steps:
- name: Download workflow artifact
Expand Down Expand Up @@ -67,18 +75,18 @@ jobs:
name: Create comment status
if: |
always() &&
github.event.workflow_run.event == 'pull_request' &&
github.event.workflow_run.pull_requests[0].number != ''
needs.publish.outputs.pr_number != ''
runs-on: ubuntu-latest
needs:
- compose-comment
- publish

steps:
- name: Update job summary in PR comment
uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
with:
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }}
message: ${{ needs.compose-comment.outputs.msg }}
pr_number: ${{ github.event.workflow_run.pull_requests[0].number }}
pr_number: ${{ needs.publish.outputs.pr_number }}
comment_tag: ${{ needs.compose-comment.outputs.marker }}
mode: recreate

0 comments on commit debdf2d

Please sign in to comment.