Skip to content
Latchkey

Dependabot auto-merge not working in CI

Dependabot does not auto-merge by itself. You must enable "Allow auto-merge" on the repository and add a workflow that calls gh pr merge --auto (or the API) on Dependabot PRs after checks pass. Without both, PRs sit open even when green.

What this error means

Green Dependabot PRs with all checks passing remain open and are never merged, and there is no merge activity in the PR timeline.

GitHub Actions
gh: Auto-merge is not enabled for this repository.
Run 'gh repo edit --enable-auto-merge' or enable it in repository settings.

Common causes

Repository auto-merge is disabled

Without "Allow auto-merge" enabled in repository settings, no PR (Dependabot or otherwise) can be queued for automatic merge.

No workflow enables auto-merge per PR

Auto-merge is opt-in per pull request. Nothing turns it on for Dependabot PRs unless a workflow explicitly enables it.

How to fix it

Enable repo auto-merge and add an enabling workflow

  1. Turn on "Allow auto-merge" in Settings > General.
  2. Add a workflow triggered on Dependabot PRs that enables auto-merge.
  3. Gate it on the actor being dependabot[bot] and on update type.
.github/workflows/automerge.yml
on: pull_request
permissions:
  contents: write
  pull-requests: write
jobs:
  automerge:
    if: github.actor == 'dependabot[bot]'
    runs-on: ubuntu-latest
    steps:
      - run: gh pr merge --auto --squash "$PR_URL"
        env:
          PR_URL: ${{ github.event.pull_request.html_url }}
          GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Ensure required checks can complete

Auto-merge only fires once required checks pass. Confirm Dependabot PRs actually run those checks (they trigger on pull_request).

How to prevent it

  • Enable "Allow auto-merge" at the repository level once.
  • Keep a single workflow that enables auto-merge for Dependabot PRs.
  • Scope auto-merge to patch/minor updates you trust.

Frequently asked questions

What causes "Auto-merge does nothing"?
Without "Allow auto-merge" enabled in repository settings, no PR (Dependabot or otherwise) can be queued for automatic merge.
How do I fix Auto-merge does nothing?
Enable repo auto-merge and add an enabling workflow

Related guides

References

Run this faster and cheaper on Latchkey managed runners - self-healing included. Start free → 30-day trial · No credit card