SIGN IN SIGN UP

feat(action): add optional pr_number input and workflow_run fallback (#1156)

* feat(action): add optional pr_number input and workflow_run fallback

The pull request number was read from the event payload in two places: the
fetch step's `github.event.pull_request.number || github.event.issue.number`,
and `context.issue.number` in the range and posting steps. Neither resolves on
`workflow_run`, whose payload names the pull request only under
`workflow_run.pull_requests[0]`. The review therefore ran to completion and the
posting step then requested /repos/OWNER/REPO/issues//comments, got a 404, and
the findings were lost.

"Resolve PR refs" now resolves the number once — the new optional `pr_number`
input, then the event payload, then `workflow_run.pull_requests[0].number` —
publishes it as $PR_NUMBER, and fails there when nothing resolves or the value
is not a PR number, before OCR is installed or any LLM quota is spent. The head
fetch, the checkpoint resolver and the posting step all read that one value;
runPostReviewComments takes it as an option and still falls back to
context.issue.number when a caller omits it.

Behavior is unchanged for pull_request, pull_request_target and issue_comment:
an unset input falls through to the existing resolution.

Closes #1150

* style(action): use strict equality for the pr_number override

The review guidelines rule out loose equality, so spell out the null and undefined checks that `!= null` covered.
D
Doksanbir committed
042c382c73d0b347c964281046aae2fed292fd1e
Parent: a694be5
Committed by GitHub <noreply@github.com> on 9/16/2026, 8:37:28 AM