Fix bot/web-flow detection.#57
Conversation
Signed-off-by: Alexander Adam <alphaone23@gmail.com>
WalkthroughUpdates the compliance workflow to generalize bot detection and skip bot-authored commits when checking DCO. Applies consistent bot-skip logic across push-range and pull request checks, with a specific exception for web-flow. Adjusts both commit and PR scanning paths to ignore commits with committer names containing “[bot]”. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor GitHub as GitHub
participant WF as Compliance Workflow
participant BotFilter as Bot Filter
participant CommitScan as Commit Scanner
participant DCO as DCO Checker
GitHub->>WF: Trigger (push or pull_request)
WF->>BotFilter: Evaluate actor/pusher name
alt Actor is bot (contains "bot") and not "web-flow"
BotFilter-->>WF: Skip workflow
WF-->>GitHub: Exit early
else Non-bot or "web-flow"
BotFilter-->>WF: Proceed
par Push-range path
WF->>CommitScan: List commits in range
loop For each commit
CommitScan->>BotFilter: Check committer name
alt Committer contains "[bot]" or is "web-flow"
BotFilter-->>CommitScan: Skip commit
else Human commit
CommitScan->>DCO: Verify Signed-off-by
DCO-->>CommitScan: Pass/Fail
end
end
and PR path
WF->>CommitScan: List PR commits
loop For each commit
CommitScan->>BotFilter: Check committer name
alt Committer contains "[bot]" or is "web-flow"
BotFilter-->>CommitScan: Skip commit
else Human commit
CommitScan->>DCO: Verify Signed-off-by
DCO-->>CommitScan: Pass/Fail
end
end
end
WF-->>GitHub: Report results
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. |
| committer_name=`git log --format=%cn -n 1 "$sha"` | ||
| if echo "$committer_name" | grep -Fq '[bot]' || [ "$committer_name" = "web-flow" ] | ||
| then | ||
| echo "Skipping bot/web-flow commit $sha from $committer_name" | ||
| continue | ||
| fi |
There was a problem hiding this comment.
Web-flow detection still misses GitHub UI commits
git log --format=%cn returns GitHub (not web-flow) for commits created via the GitHub web UI, so these loops still process the very commits we’re trying to exempt. The DCO check will continue to fail on “Update branch”/web-flow commits. Please adjust the detection (e.g., treat committer_name == "GitHub" with committer_email == "noreply@github.com", or fetch the committer login via the API) so that web-flow generated commits are actually skipped.
Also applies to: 149-154
🤖 Prompt for AI Agents
.github/workflows/compliance.yml around lines 85-90 (also fix the identical
logic at 149-154): the existing check only looks for committer names containing
"[bot]" or equal to "web-flow" but misses GitHub web UI commits which show
committer_name "GitHub"; update the detection to also read the committer email
(e.g., use git log --format=%cn and --format=%ce or a single command to capture
both) and skip commits where committer_name == "GitHub" AND committer_email ==
"noreply@github.com"; alternatively, fetch the committer login from the API if
preferred—apply the same change to the duplicate block at lines 149-154.
Summary by CodeRabbit
Bug Fixes
Chores