chore(ci): guard commit identity in pre-commit to stop author misattribution - #12772
Open
diegosouzapw wants to merge 1 commit into
Open
chore(ci): guard commit identity in pre-commit to stop author misattribution#12772diegosouzapw wants to merge 1 commit into
diegosouzapw wants to merge 1 commit into
Conversation
…ibution Two windows of commits in this checkout were signed with the wrong identity, both caused by an identity override left behind by an automated session: 2026-08-13..26 (name "Xiangzhe" + @backryun's e-mail, 237 commits) and 2026-08-29..09-02 (name "Markus Hartung" + the maintainer's e-mail, 59 commits). The .mailmap repairs the record after the fact; this gate stops the next window. The gate is opt-in per machine via omniroute.expectedName / expectedEmail — with no config it exits 0, so contributors who clone the repo are never affected. It blocks three things: a committer that is not this machine's identity (which is what BOTH windows looked like — in August neither the name nor the e-mail was the maintainer's, so checking only their e-mail would have missed it), an author carrying the maintainer's e-mail under someone else's name, and any address listed in omniroute.legacyEmail. Crediting a contributor with `git commit --author="Name <their@email>"` keeps working, since the rule targets the committer and the maintainer's own address.
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.
Why
This checkout has produced two windows of commits signed with the wrong identity, both caused by an identity override left behind by an automated session:
Xiangzhe(@xz-dev) + e-mail de @backryunMarkus Hartung+ e-mail do mantenedorThe root-level
.mailmaprepairs the record after the fact (it was added for the first window, and already covers the second by e-mail). It cannot prevent the next one — this gate can.Of the 59 commits in the second window, 58 lived only on branches that were later squash-merged, so they never entered the release history; the squashes carry the correct authorship. One (
f5742c3a) is onrelease/v3.8.51and is left as-is, normalized by.mailmap— rewriting it would force-push a branch other sessions and open PRs build on.What the gate does
scripts/check/check-git-identity.sh, wired as the first step of.husky/pre-commit(cheapest gate first, so it fails before the expensive ones run).It blocks three things:
omniroute.legacyEmail(e.g. the retireddiegosouzapw@users.noreply.github.com).Contributors are not affected
The gate is opt-in per machine. With no
omniroute.expectedEmailconfigured it exits 0 immediately, so anyone who clones the repo commits normally.Crediting a contributor with
git commit --author="Name <their@email>"keeps working — the rule targets the committer and the maintainer's own address, never the author's name.Tests
tests/unit/check-git-identity.test.ts— 7 cases, all green:Verified end-to-end that the hook actually blocks: husky runs hooks with
sh -e, so the gate aborts the commit beforelint-stagedruns.Pre-commit gates run manually (this worktree uses
cp -alnode_modules, which does not populate.husky/_): prettier, eslint,check-docs-sync,check:any-budget:t11,check-tracked-artifacts— all pass.