Repository navigation
BAI-1601 stop trusting commit author on push for Dependabot exemption - #175
Merged
Merged
Conversation
…subjects in pattern
alvinhenrick
approved these changes
Nov 12, 2026
alvinhenrick
left a comment
There was a problem hiding this comment.
Approving at 87a0e97.
What I checked in .github/workflows/check-commit-message.yml:
if:: on apusheventgithub.event.pull_requestis null, sonull != 'dependabot[bot]'is true and the key check runs on every push. The bypass throughhead_commit.author.name, a free-text field that a rebase merge keeps, is gone. A Dependabot PR is still skipped because the check keys onpull_request.user.login, which can't be forged from a commit.- Pattern:
chore\(deps(-dev)?\): [Bb]umpfollowed by the existing\s+.+acceptschore(deps): bump foo from 1.0 to 1.1 (#N)and rejectschore(deps): remove fooandchore(ci): bump x. The existingBumpandbuild(deps...)alternatives are unchanged. - Docs: the
playbooks/MERGING.mdline matches the new behavior. - Commit: one commit, subject has the BAI-1601 key, no AI-attribution trailer. Scope is the workflow and one docs line, nothing unrelated.
Non-blocking:
- The push check catches a human commit with no key only after it lands on
main, if someone adds keyless commits to a Dependabot PR and rebase-merges it. The PR run skips that case. That's fine as a detective control, but say so in MERGING.md so a redmainrun isn't a surprise. - This existed before the PR: with
flags: 'gm',^matches at the start of every line, so a message likefix stuff\n\nBAI-1 detailspasses. If the intent is "the subject starts with a key", dropm. That needs a separate ticket, not this PR.
I can't verify CI status here (the status and check-run endpoints return 403 for this integration). This approval is based on reading the diff.
…re start with Bump
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.
What
Check Commit Messageno longer trusts the git author on a push. Only a PR authored bydependabot[bot]is exempt from the Jira-key check; a push tomainorreleases/*always runs it. The commit-subject pattern is unchanged: Dependabot's squash commit here is titledBump ...(for exampleBump joserfc from 1.7.1 to 1.7.6) and passes on the existingBumpalternative. Nochore(deps)alternative is added, because the org baseline in AGENTS.md banschore:prefixes and this repo's Dependabot commits do not use one. playbooks/MERGING.md states this in one clause.Why
head_commit.author.nameis a free-text git field, and a rebase merge keeps the original author. A single commit authored asdependabot[bot]and rebase-merged therefore reachedmainwith the key check skipped. This repo allows rebase merges (repo setting, and thebranch protectionruleset'spull_requestrule). The impact is a commit message without a key onmain: the PR title is still checked on the PR run, and the ruleset still requires a PR. The earlier exemption here is #170; the gap was raised in review on icanbwell/ai-health-optimization#97, which carries the same change.Verification
if:andpattern:evaluated against synthetic payloads (Node, with GitHub's null-safe property access modeled). Before this change 2 of 21 cases failed: a push whose author is forged asdependabot[bot]and a Dependabot squash push skipped the check. After it all 21 pass. They cover: a Dependabot PR is skipped; a human PR, a human push and a forged-author push run the check;Bump ...,Merge ...andbuild(deps): bump ...subjects are accepted;fix stuff,chore: tidy up,chore(deps): bump x,chore(deps-dev): bump x,chore(deps): remove foo,chore(ci): bump xandfeat(deps): bump xare rejected.main.Tenancy, PHI, public contracts, event schemas and dependencies: not affected (CI workflow and docs only).
Jira: BAI-1601.