Skip to content

BAI-1601 stop trusting commit author on push for Dependabot exemption - #175

Merged
sean-can-bwell merged 2 commits into
mainfrom
SH-BAI-1601-push-gate
Nov 12, 2026
Merged

sean-can-bwell merged 2 commits into
mainfrom
SH-BAI-1601-push-gate

Conversation

@sean-can-bwell

@sean-can-bwell sean-can-bwell commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

What

Check Commit Message no longer trusts the git author on a push. Only a PR authored by dependabot[bot] is exempt from the Jira-key check; a push to main or releases/* always runs it. The commit-subject pattern is unchanged: Dependabot's squash commit here is titled Bump ... (for example Bump joserfc from 1.7.1 to 1.7.6) and passes on the existing Bump alternative. No chore(deps) alternative is added, because the org baseline in AGENTS.md bans chore: prefixes and this repo's Dependabot commits do not use one. playbooks/MERGING.md states this in one clause.

Why

head_commit.author.name is a free-text git field, and a rebase merge keeps the original author. A single commit authored as dependabot[bot] and rebase-merged therefore reached main with the key check skipped. This repo allows rebase merges (repo setting, and the branch protection ruleset's pull_request rule). The impact is a commit message without a key on main: 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

  • The workflow's own if: and pattern: 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 as dependabot[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 ... and build(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 x and feat(deps): bump x are rejected.
  • This PR's own run covers the human-author path. The skip path on a real Dependabot PR is confirmed on the next Dependabot PR, and the push path on the merge to main.

Tenancy, PHI, public contracts, event schemas and dependencies: not affected (CI workflow and docs only).

Jira: BAI-1601.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

@alvinhenrick alvinhenrick left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Approving at 87a0e97.

What I checked in .github/workflows/check-commit-message.yml:

  • if:: on a push event github.event.pull_request is null, so null != 'dependabot[bot]' is true and the key check runs on every push. The bypass through head_commit.author.name, a free-text field that a rebase merge keeps, is gone. A Dependabot PR is still skipped because the check keys on pull_request.user.login, which can't be forged from a commit.
  • Pattern: chore\(deps(-dev)?\): [Bb]ump followed by the existing \s+.+ accepts chore(deps): bump foo from 1.0 to 1.1 (#N) and rejects chore(deps): remove foo and chore(ci): bump x. The existing Bump and build(deps...) alternatives are unchanged.
  • Docs: the playbooks/MERGING.md line 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:

  1. 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 red main run isn't a surprise.
  2. This existed before the PR: with flags: 'gm', ^ matches at the start of every line, so a message like fix stuff\n\nBAI-1 details passes. If the intent is "the subject starts with a key", drop m. 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.

@sean-can-bwell sean-can-bwell changed the title BAI-1601 stop trusting commit author on push; accept Dependabot bump subjects in pattern BAI-1601 stop trusting commit author on push for Dependabot exemption Nov 12, 2026
@sean-can-bwell
sean-can-bwell merged commit cf557b8 into main Nov 12, 2026
5 checks passed
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