Resolve PR number for workflow_run events and use it for gh comments/reviews#1532
Merged
Resolve PR number for workflow_run events and use it for gh comments/reviews#1532
Conversation
This was referenced Feb 25, 2026
|
Checks from Request Change Test PR #1535 |
|
Checks from Push as App Test PR #1533
|
|
Checks from Comment Test PR #1536 |
|
Checks from Push Test PR #1534
|
0a70d71 to
050036c
Compare
This was referenced Feb 25, 2026
|
Checks from Push Test PR #1538 |
|
Checks from Comment Test PR #1537 |
|
Checks from Push as App Test PR #1539 |
|
Checks from Request Change Test PR #1540 |
This was
linked to
issues
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
pull_request(for exampleworkflow_run) by resolving the PR number from the event payload.Description
get-pr-numberstep that extracts the PR number fromgithub.event.pull_request.numberorgithub.event.workflow_run.pull_requests[0].numberand exposes it aspr-numberoutput.github.event_name == 'pull_request'and instead gate PR actions onsteps.get-pr-number.outputs.pr-number != ''so the action can run for non-pull_requestevents when a PR is present in the payload.gh pr reviewandgh pr commentinvocations to pass the explicit PR number argument (e.g.gh pr review "${PR_NUMBER}" -rb ...).get-tokensstep condition to run token population when changes are detected andrequest-changes-if-not-cleanorpush-if-not-cleanis enabled regardless ofgithub.event_name.Testing
Codex Task