Repository navigation
ci: reject attribution trailers and emails in commits and prs - #18
Merged
Merged
Conversation
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.
Summary
Adds a guard that keeps attribution trailers and email addresses out of commit messages and PR text.
.github/scripts/: shared matchers (attribution-lib.sh) plus three entry points.check-commit-msg.shchecks one message file,check-co-authors.shchecks every commit inbase..head, andcheck-pr-attribution.shchecks the PR title and body..github/workflows/check-commit-attribution.yml: runs onpull_request(opened,synchronize,reopened,edited) and scans every commit in the PR plus its title and description. The title and body are passed throughenv, never interpolated into the script; an empty body is handled.lefthook.yml: acommit-msghook that runs the same matchers locally. There is no pre-commit hook. Runlefthook installonce per clone;lefthook-local.ymlis gitignored.CLAUDE.md: a rule that commit messages and PRs carry no attribution or email addresses.What gets rejected:
Co-authored-bytrailers, generated-by / made-with signatures naming a coding agent, the robot-emoji "Generated" signature, assisted-by trailers, and any email address. Look-alikes such asicon@2x.pngor "can generate reports" pass. Skipping the local hook with--no-verifyorLEFTHOOK=0does not get past CI.Test plan
bash -non all four scripts;lefthook validatelefthook run commit-msgpasses a clean message and rejects one with an emailcheck-co-authors.shpasses on the last 8 commits ofmainAfter merge
Mark Check commit attribution as a required check in branch protection. The workflow cannot enable that.