fix: resolve fork PRs in bumpy ci comment - #160
Open
theoephraim wants to merge 1 commit into
Open
Conversation
Under workflow_run, GET commits/{head_sha}/pulls only knows about commits in the
base repo's own branches, so for fork PRs it returns [] and ci comment exited 1.
Fall back to scanning open PRs (paginated) and matching head.sha against the
trusted workflow_run.head_sha. Target still never comes from the artifact or
from workflow_run.pull_requests[] (empty for forks).
|
The changes in this PR will be included in the next version bump.
|
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in the fork PR resolution path, its regression coverage, and the release note.
- Fork fallback — Keeps the commit association lookup as the fast path, then paginates open pull requests and matches the trusted
workflow_run.head_shaagainsthead.sha. - Trust boundary — Continues deriving the comment target exclusively from the validated GitHub event SHA rather than artifact-controlled data.
- Regression coverage — Exercises same-repository resolution, fork fallback including pagination and SHA filtering, and the no-match case; focused tests, type checking, and formatting checks pass.
- Release metadata — Adds a patch bump entry describing the corrected fork behavior.
azure/gpt-5.6-sol | 𝕏
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.



Problem
bumpy ci commentunderworkflow_runresolved the target PR viaGET repos/{repo}/commits/{head_sha}/pulls. That endpoint only returns PRs whose head commit lives in the base repo's own branches. For a PR opened from a fork the head commit isn't there, so it returned[]and the command exited 1 with "Could not resolve a target PR". Same-repo PRs already worked before the 1.18 fork-safe split; fork PRs are exactly what the split exists for.Example: https://github.com/dmno-dev/varlock/actions/runs/34675271163 (fork PR dmno-dev/varlock#1075).
Fix
Keep the commits-endpoint lookup as the first attempt; when it's empty, fall back to:
--paginatecovers repos with >100 open PRs. The target still derives only from the trustedworkflow_run.head_sha— never from the artifact, and never fromworkflow_run.pull_requests[](which GitHub leaves empty for forks).Tests
--paginateand thehead.shafilter)Patch bump file included; varlock pins
^1.18.1and should update once released.