Is there any way to reliably check out the whole repository tree for testing given only the SHA of a commit?
The check_run event only delivers the head_sha in all cases. head_branch and associated PRs etc all are populated only when the PR is from the same repo, not when it is from a fork. The same holds true for the new APIs to get pulls and branches from a commit, associatedPullRequests, etc. All of those only work within a repo, not for forks.
As it is, there are only two ways I can see, both of which very awkward:
- Check out the entire repo with +refs/pull//head:refs/remotes/origin/pull/ set, which makes it HUGE and take forever, seconds for larger repos to do a single fetch.
- Listen to pull_request/synchronize events and remember the PR/branch for each head_sha in a local database.
There must be a better way? How is this supposed to work? I need the whole repo to do a check on a check_run, but in 99% of the real world cases I can’t check out the commit without jumping through a ton of hoops…