Skip to content

fix: check the author of every pull request commit - #332

Merged
shenxianpeng merged 3 commits into
mainfrom
fix/check-every-pr-commit-author
Nov 10, 2026
Merged

shenxianpeng merged 3 commits into
mainfrom
fix/check-every-pr-commit-author

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

author-name and author-email checked only the pull request's last commit. An earlier commit by another author was never checked, so a GitHub noreply address forbidden by author_email_pattern (the setup from commit-check#651) passed whenever the last commit used a real address.

Now each distinct author of the pull request's commits is checked once, on the newest commit that carries it, with --rev <sha>. A one-person pull request still gets one scope per check. A commit the clone lacks is fetched without its history; if one still cannot be had, the tip is checked as before.

Before / after

A pull request with two commits: the first by dev@users.noreply.github.com, the second by dev@example.org, and the noreply-forbidding author_email_pattern:

# before (main)
::group::Author
  ✔ Author email (dev@example.org)
::endgroup::
✔ commit-check: all checks passed

# after
::group::Author
  ✖ Author email (c3f47f6) (1 failure)
  ✔ Author email (efb63be) (dev@example.org)
::endgroup::
✖ commit-check: 1 of 2 checks failed

Tests

pytest main_test.py: 288 passed. New tests: an earlier commit by another author is checked, one author is checked once on the newest commit, an API-listed author is used, and a commit that cannot be fetched falls back to the tip. The before/after above is a local run of main.py against a real repository with a pull_request event payload.

author-name and author-email read only the branch tip, so an earlier
commit by another author went unchecked: a GitHub noreply address
forbidden by author_email_pattern passed when the last commit used a
real one. Each distinct author of the pull request's commits is now
checked once, on the newest commit that carries it. When a commit
cannot be had, even by fetching it, the tip is checked as before.
@shenxianpeng
shenxianpeng requested a review from a team as a code owner November 10, 2026 07:56
@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 32 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 999f71ad-a973-40b0-8822-a68cee5fdb19
Commits

Reviewing files that changed from the base of the PR and between 63e0608 and 9b07f3f.

Files selected for processing: 2

  • main.py
  • main_test.py
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@shenxianpeng shenxianpeng self-assigned this Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Commit Check

✅ All 8 checks passed

Show all 8 checks
Pull request
  ✔ PR title (fix: check the author of every pull request commit)
  ✔ PR description (`author-name` and `author-email` checked only the pull re...)
Commit message
  ✔ Commit 1/3 (a7b2639) (fix: check the author of every pull request commit)
  ✔ Commit 2/3 (15008b6) (test: cover listing the commits once and an unreadable au...)
  ✔ Commit 3/3 (9b07f3f) (Merge remote-tracking branch 'origin/main' into fix/check...)
Author
  ✔ Author name (9b07f3f) (Xianpeng Shen)
  ✔ Author email (9b07f3f) (3353385+shenxianpeng@users.noreply.github.com)
Branch
  ✔ Branch (fix/check-every-pr-commit-author)

commit-check 2.20.2 · Rules reference

@github-actions github-actions Bot added the ai-assisted Written with the help of an AI tool label Nov 10, 2026
@shenxianpeng shenxianpeng removed the ai-assisted Written with the help of an AI tool label Nov 10, 2026 — with Claude
@codecov

codecov Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (63e0608) to head (9b07f3f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #332   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          822       842   +20     
=========================================
+ Hits           822       842   +20     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@shenxianpeng shenxianpeng added the bug Something isn't working label Nov 10, 2026 — with Claude
@shenxianpeng
shenxianpeng merged commit 7a915fb into main Nov 10, 2026
18 checks passed
@shenxianpeng
shenxianpeng deleted the fix/check-every-pr-commit-author branch November 10, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant