fix(bin): read cross-repo PR checks from the head repository - #5796
Closed
mehulbhagwani wants to merge 1 commit into
Closed
mehulbhagwani wants to merge 1 commit into
mehulbhagwani wants to merge 1 commit into
Conversation
fm-contributions.sh queried check-runs and commit statuses against the PR's base repository, even when the head commit only exists on a fork. GitHub's commits API silently returns zero results for a SHA it cannot resolve in that repository, so a cross-repo PR was observed as having no checks at all. Read .head.repo.full_name from the PR core response and query check-runs and statuses there instead, falling back to the base repository when the head repo is absent (a deleted fork).
mehulbhagwani
force-pushed
the
fm/fm-contributions-cross-repo-checks
branch
from
September 27, 2026 14:47
b12f725 to
d7db224
Compare
Author
|
Superseded by #5919; will close once it lands. |
Author
|
Closing as superseded by #5919, which carries the same fix rebased on current main. |
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
fm-contributions.shqueried check-runs and commit statuses against thePR's base repository, even when the PR's head commit only exists on a
fork. GitHub's commits API silently returns zero results for a SHA it
cannot resolve in that repository, so a contribution whose PR page is
on the base repo but whose commits live on a fork (e.g. a PR opened
mehulbhagwani:branch->kunchenguid/firstmate:main) was observed ashaving no checks at all instead of its real check-run results.
Reproduced directly against #4932:
querying
repos/kunchenguid/firstmate/commits/<sha>/check-runsreturnstotal_count: 0, whilerepos/mehulbhagwani/firstmate/commits/<sha>/check-runsreturns the real 20 check-runs for that commit.
Fix
Read
.head.repo.full_namefrom the PR core response and querycheck-runs and statuses there instead of the base repo, falling back to
the base repository when the head repo field is absent (a deleted
fork).
Testing
FM_HOMEbefore andafter the fix, confirming
checkswent from empty to the real 20check-runs with no error.
test_cross_repo_checks_use_head_repototests/fm-contributions.test.sh, asserting check-runs/statuses areread from the head repo and not the base repo when they differ.
tests/fm-contributions.test.shpasses (40/40).