DEV Community

Cover image for Auto-merging dependency PRs isn't reckless. Doing it without these 4 rules is.
Versyka
Versyka

Posted on AI-assisted

Auto-merging dependency PRs isn't reckless. Doing it without these 4 rules is.

Never auto-merge without these 4 rules. Your CI isn't enough. "Auto-merging dependency PRs is reckless" is the most common objection to dependency automation, and it's right if there are no rules. These are the four we wrote before shipping auto-merge for version bumps.

1. Only version bumps

The pull request changes version numbers in manifests and lockfiles and nothing else. The moment a PR touches code (a migration, a renamed function, a config change), it waits for a person. For us, that's the line between "this is routine" and "this needs judgement".

2. Every CI check passes

Not most, not only the required ones. All of them. And the rule people forget: no CI at all means no merge. A PR with zero checks passes "all checks green" in most scripts, which is how a bot merges untested code.

3. Never past a required review

If your branch protection asks for a reviewer, auto-merge waits for one. Automation should sit inside your rules, never around them.

4. Never after someone else pushes

If a person added a commit to the bot's branch, the PR is theirs now. They might be halfway through a fix. We'd hate that done to us, and merging underneath someone is the fastest way to lose a team's trust in automation.

Plus one habit: say why

Whenever it merges, it comments on the pull request to say why it was allowed to. Six months later, you'll thank yourself: the history explains itself.

Doing it yourself

  • Turn on branch protection with required status checks and required reviews.
  • Allow auto-merge only for patch and minor updates. Dependabot's fetch-metadata action plus gh pr merge --auto is a common pattern.
  • In that workflow, check that at least one status check exists before enabling auto-merge.

How it works in Versyka

One switch in Settings → Automation, off by default, on every plan, GitHub only. It follows the four rules above, and migrations and AI model replacements never merge on their own.

Which rule would you add as number five?

Top comments (0)