Skip to content

feat: add a guard on the commits of Dependabot pull requests - #24

Merged
zigzago merged 1 commit into
mainfrom
feat/check-bot-commits
Nov 6, 2026
Merged

zigzago merged 1 commit into
mainfrom
feat/check-bot-commits

Conversation

@zigzago

@zigzago zigzago commented Nov 6, 2026

Copy link
Copy Markdown
Member

Summary

The approval of a Dependabot pull request survives its next commits, which the auto-merge needs for the commits of the bot. This adds a check that limits what those commits can do.

Changes

  • check-bot-commits action: the first commit comes from Dependabot, and the next ones come from the bot and only change the given paths. It does nothing on another pull request.
  • dependabot-commit-guard.yml reusable workflow, meant to be a required check. It is called on every pull request, since a required check of a job skipped by the caller stays pending.
  • CI test against a merged Dependabot pull request.

Limit

The check relies on the commit author that GitHub reports. It raises the bar and limits the paths, but a token with write access could still rewrite the branch.

Test plan

  • Run locally against real pull requests: valid flow accepted, unexpected path and unexpected author rejected, other pull request ignored
  • zizmor and actionlint report nothing
  • check-bot-commits CI job passes

The approval of a Dependabot pull request survives its next commits. This check
fails when one of them does not come from the bot, or changes other paths than
the expected ones.
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@zigzago
zigzago merged commit 9e64100 into main Nov 6, 2026
11 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.

1 participant