Skip to content

Commit

Permalink
Merge pull request #5879 from thornbill/publish-ci-pr-number
Browse files Browse the repository at this point in the history
Add PR number to environment for debugging workflow
  • Loading branch information
thornbill authored Aug 5, 2024
2 parents da2d825 + b2c7ab8 commit a771246
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,18 @@ jobs:
&& github.event.workflow_run.head_branch
|| format('{0}/{1}', github.event.workflow_run.head_repository.full_name, github.event.workflow_run.head_branch)
}}
EVENT: ${{ github.event.workflow_run.event }}
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 +76,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 a771246

Please sign in to comment.