Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭 适合新手
#10,579 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
84/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
git, github-actions
领域
ci-cd

调研方向

阅读 .github/workflows/lint-build-test.yml 和 .github/actions/check-merge-queue-changelogs,然后检查 Validate changelog diffs 步骤及其 pull request 事件上下文。验证来源于 fork 的 pull request 可以完成 changelog 差异验证,同时 merge_group 的行为和每个 package 的 changelog 检查仍然通过。

由索引模型根据 Issue 内容生成。

描述

Bug

"Lint, build, and test / Validate changelog diffs" fails on every fork-sourced pull request, independent of the PR's content.

Root cause

The validate-changelog-diffs job (.github/workflows/lint-build-test.yml) runs the composite action .github/actions/check-merge-queue-changelogs, whose "Check changelog changes" step computes:

TARGET_REF=$(git merge-base "origin/$BASE_REF" "origin/$PR_BRANCH")

For a PR whose head lives on a fork, origin/$PR_BRANCH does not exist in the job's checkout (fork head branches are fetched as refs/pull/N/merge, not as remote branches under origin), so the job dies before validating anything:

fatal: Not a valid object name origin/feature/use-memory-see-this-sp0
##[error]Process completed with exit code 128.

The job has no skip condition beyond the event type, so this affects every fork-sourced PR.

Evidence
  • PR #10535 (fork branch feature/use-memory-see-this-sp0) — job run: https://github.com/MetaMask/core/actions/runs/36560718378/job/109380743283
    • The job failed on every commit the PR has ever had — including its very first commit ca6a523772 — i.e., the failure is independent of the PR's changes and occurs before any changelog diff is computed (the per-package Validate changelog (24.x, @metamask/assets-controller) job passes for the same commits).
  • PR #10229 (fork branch feat/assets-transient-loading-state) — the same job shows FAILURE on its head commits (db682a870f, 47b7803dfd).
Impact
  • Every fork-sourced PR shows a red "Validate changelog diffs" check (and the "All jobs pass" aggregate) for a reason unrelated to the PR, making genuinely failing checks harder to spot and fork PRs appear blocked.
Suggested fix direction

In the "Check changelog changes" step, when origin/$PR_BRANCH is unavailable (fork PRs), fetch the PR head ref before computing the merge base, e.g.:

git fetch origin "+refs/pull/${PR_NUMBER}/head:refs/remotes/origin/${PR_BRANCH}"

(or resolve the merge base against refs/pull/${PR_NUMBER}/merge directly, which the checkout already has).

Note: for merge_group events the current logic works, because merge-queue branches do exist under origin.

主要语言
TypeScript
星标
414
派生
310
平均合并
1 天 16 小时
30 天内合并 PR
415

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MetaMask/core 的其他 Issue

查看 MetaMask/core 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。