ci: add PR commit message sanity check workflow#10285
ci: add PR commit message sanity check workflow#10285LinuxJedi wants to merge 1 commit intowolfSSL:masterfrom
Conversation
Adds a GitHub Actions workflow that scans every commit in a pull request and fails if any commit message carries a Co-authored-by or Signed-off-by trailer pointing at noreply@anthropic.com. Named generically so further PR commit-message sanity checks can be added as additional steps. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions workflow to enforce PR commit-message hygiene by scanning all commits in a pull request and failing when disallowed attribution trailers reference noreply@anthropic.com.
Changes:
- Introduces a new
pr-commit-check.ymlworkflow triggered onpull_request. - Checks every PR commit message for
Co-authored-by:/Signed-off-by:trailers containingnoreply@anthropic.comand fails the job if found.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| while IFS= read -r sha; do | ||
| [ -z "$sha" ] && continue | ||
| if git log -1 --format=%B "$sha" | \ | ||
| grep -iE '^(Co-authored-by|Signed-off-by):.*<?noreply@anthropic\.com>?' >/dev/null; then |
There was a problem hiding this comment.
The grep pattern can produce false positives because it matches any address containing the substring noreply@anthropic.com (e.g., noreply@anthropic.com.example) and it doesn’t enforce an end-of-email boundary. Consider tightening the regex to require either end-of-line or a closing >/whitespace after the domain, and optionally allow leading whitespace before the trailer key so indented trailers are also caught.
| grep -iE '^(Co-authored-by|Signed-off-by):.*<?noreply@anthropic\.com>?' >/dev/null; then | |
| grep -iE '^[[:space:]]*(Co-authored-by|Signed-off-by):.*<?noreply@anthropic\.com($|[[:space:]>])' >/dev/null; then |
Adds a GitHub Actions workflow that scans every commit in a pull request and fails if any commit message carries a Co-authored-by or Signed-off-by trailer pointing at noreply@anthropic.com. Named generically so further PR commit-message sanity checks can be added as additional steps.
This is a test