Skip to content

ci: resolve pull request head commit for fork changelog checks (#10579) - #11021

Open
Roxen-AS wants to merge 1 commit into
MetaMask:mainfrom
Roxen-AS:fix/ci-changelog-fork-prs-10579
Open

Roxen-AS wants to merge 1 commit into
MetaMask:mainfrom
Roxen-AS:fix/ci-changelog-fork-prs-10579

Conversation

@Roxen-AS

@Roxen-AS Roxen-AS commented Oct 22, 2026 •

Copy link
Copy Markdown

Explanation

Summary

Resolve the pull request head commit through refs/pull/<number>/head in 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/ in MetaMask/core. That assumption fails for pull requests opened from a fork repository, causing both checks to fail before running any changelog validation:

  • In Validate changelog diffs (check-merge-queue-changelogs), git merge-base "origin/$BASE_REF" "origin/$PR_BRANCH" fails with fatal: Not a valid object name origin/....
  • In Check changelog (changelog-check.yml), actions/checkout cannot locate github.head_ref in github.repository.

Solution

  • check-merge-queue-changelogs: Fetch refs/pull/<number>/head into refs/remotes/pr/<number>/head and use that ref instead of origin/$PR_BRANCH. This also eliminates the redundant gh api lookup for branch name.
  • changelog-check.yml: Pass head-ref: refs/pull/${{ github.event.pull_request.number }}/head to MetaMask/github-tools/.github/actions/check-changelog@v1.

References

Fixes #10579

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

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>/head instead of assuming the head branch exists on origin/.

In check-merge-queue-changelogs, the gh api branch lookup is replaced with a git fetch of that pull ref into refs/remotes/pr/<number>/head; merge-base, diff, and git show for changelog validation all use that ref. In changelog-check.yml, check-changelog now receives head-ref: refs/pull/.../head instead of github.head_ref.

Reviewed by Cursor Bugbot for commit cff144d. Bugbot is set up for automated code reviews on this repo. Configure here.

…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>
@Roxen-AS
Roxen-AS requested a review from a team as a code owner October 22, 2026 23:47

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI: "Validate changelog diffs" job fails on every fork-sourced pull request

1 participant