Skip to content

ci: add PR commit message sanity check workflow#10285

Closed
LinuxJedi wants to merge 1 commit intowolfSSL:masterfrom
LinuxJedi:git-action
Closed

ci: add PR commit message sanity check workflow#10285
LinuxJedi wants to merge 1 commit intowolfSSL:masterfrom
LinuxJedi:git-action

Conversation

@LinuxJedi
Copy link
Copy Markdown
Member

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

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>
Copilot AI review requested due to automatic review settings April 23, 2026 05:52
@LinuxJedi LinuxJedi marked this pull request as ready for review April 23, 2026 05:54
@LinuxJedi LinuxJedi marked this pull request as draft April 23, 2026 05:54
@LinuxJedi LinuxJedi self-assigned this Apr 23, 2026
@LinuxJedi LinuxJedi closed this Apr 23, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.yml workflow triggered on pull_request.
  • Checks every PR commit message for Co-authored-by: / Signed-off-by: trailers containing noreply@anthropic.com and 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
Copy link

Copilot AI Apr 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

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.

2 participants