ci: lint PR title and validate trusted actors on title, not bodies - #13
Merged
Conversation
The Semantic commits job had two gaps that kept every Dependabot PR red. It never linted the PR title, though the adopted Conventional Commits standard requires it and the title becomes the squash-merge subject. It is now linted for every actor against the repo's own commitlint.config.mjs. It also did not consume the actor classification the other two policy jobs already use, so it linted Dependabot's generated commit bodies. Those bodies carry long dependency-compare URLs that the bundled commitlint flags as body-max-line-length errors, on content no human wrote. Commit-body linting is now gated to human PRs; trusted automation is validated on its title instead. body-max-line-length stays enforced for humans, unchanged. The trusted-actor exemption for commit bodies mirrors the branch-naming and issue-link jobs and ships in the workflow rather than being added reactively. The job name is unchanged, so the branch-protection required check still matches. Closes #12
The actor classifier trusted any PR whose head branch was named dependabot/* or release-please--*. A branch name is attacker-controlled, so a human could open a PR from a branch named dependabot/foo and be classified trusted. With commit-body linting now gated on that classification, such a spoofer would also skip body-max-line-length, which the policy forbids waiving for humans. Trust now requires the actor to be the automation: dependabot[bot] for Dependabot, or any [bot] actor on a release-please--* branch for release-please. github.actor is set by GitHub and cannot be spoofed by a human contributor, whose actor never carries the [bot] suffix. Real Dependabot and release-please PRs are unaffected. Follows an adversarial review of this PR.
Owner
Author
Adversarial review dispositionsAn independent review confirmed no merge-blocker and empirically verified the
|
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.
Fixes the two gaps in the
Semantic commitsjob that keep every Dependabot PR(#1 through #5) red.
What was wrong
The job never linted the PR title, though the adopted Conventional Commits standard
requires it and the title becomes the squash-merge subject. And it did not consume
the
actorclassification the other two policy jobs already use, so it lintedDependabot's generated commit bodies. Those bodies carry long dependency-compare
URLs that the bundled commitlint flags as
body-max-line-lengtherrors, on contentno human wrote.
Fix
Semantic commitsnowneeds: actor.commitlint.config.mjs(the missing standard). Bot titles likeci: bump actions/checkout from 5.1.0 to 7.0.1are conventional and pass.its title instead.
body-max-line-lengthis unchanged for humans.The job name stays
Semantic commits, so the branch-protection required check isunchanged.
Verification
Title lint checked locally against the repo config: passes valid human, Dependabot,
and release-please titles; fails a title with no type, a capitalized type, and an
unknown type. This PR's own run exercises the human path. Confirming #1 through #5
go green happens after this lands and those branches are rebased, because
pull_requestchecks run the workflow the PR branch carries.Noted, not folded in
The Dependabot bodies fail only because the
wagoidaction bundles an oldercommitlint. Modern commitlint exempts long URL lines from
body-max-line-length(a bare-URL line passes; a 130-char prose line still fails). Bumping the engine is a
separate, optional improvement; it would change human commit behavior, which this
change deliberately leaves untouched.
Closes #12