Repository navigation
Conversation
…ask#10579) Resolve the pull request head commit through refs/pull/<number>/head in both changelog checks so they function correctly for pull requests opened from a fork repository. Fixes MetaMask#10579 Signed-off-by: Roxen-AS <akash.arjun12@gmail.com>
This branch has not been deployed
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.
Explanation
Summary
Resolve the pull request head commit through
refs/pull/<number>/headin both changelog checks so that they resolve properly for pull requests opened from a fork.Problem
Both changelog checks assume the pull request head branch exists under
origin/inMetaMask/core. That assumption fails for pull requests opened from a fork repository, causing both checks to fail before running any changelog validation:Validate changelog diffs(check-merge-queue-changelogs),git merge-base "origin/$BASE_REF" "origin/$PR_BRANCH"fails withfatal: Not a valid object name origin/....Check changelog(changelog-check.yml),actions/checkoutcannot locategithub.head_refingithub.repository.Solution
check-merge-queue-changelogs: Fetchrefs/pull/<number>/headintorefs/remotes/pr/<number>/headand use that ref instead oforigin/$PR_BRANCH. This also eliminates the redundantgh apilookup for branch name.changelog-check.yml: Passhead-ref: refs/pull/${{ github.event.pull_request.number }}/headtoMetaMask/github-tools/.github/actions/check-changelog@v1.References
Fixes #10579
Checklist
Note
Low Risk
CI-only workflow changes with no runtime or application code impact.
Overview
Fixes changelog CI for fork pull requests by resolving the PR head via GitHub’s
refs/pull/<number>/headinstead of assuming the head branch exists onorigin/.In
check-merge-queue-changelogs, thegh apibranch lookup is replaced with agit fetchof that pull ref intorefs/remotes/pr/<number>/head; merge-base, diff, andgit showfor changelog validation all use that ref. Inchangelog-check.yml,check-changelognow receiveshead-ref: refs/pull/.../headinstead ofgithub.head_ref.Reviewed by Cursor Bugbot for commit cff144d. Bugbot is set up for automated code reviews on this repo. Configure here.