Skip to content
Latchkey

GitHub Actions "Pull request is not mergeable" (auto-merge)

Enabling auto-merge or merging via the API only succeeds when the PR is in a mergeable state. Conflicts, required-but-unfinished checks, or unmet branch protection rules return a not-mergeable error.

What this error means

An auto-merge/merge step fails reporting the pull request is not mergeable, even though the workflow expects to merge it.

github-actions
Error: Pull request is not mergeable (405).

Common causes

Required checks not yet passing

Branch protection requires status checks that have not completed.

Merge conflicts or review requirements

Conflicts or unmet review/approval rules block the merge.

How to fix it

Use auto-merge and satisfy protection

  1. Enable auto-merge so GitHub merges once all required checks pass.
  2. Ensure the workflow has the permissions to enable auto-merge.
  3. Resolve conflicts and satisfy required reviews/approvals.
.github/workflows/automerge.yml
permissions:
  contents: write
  pull-requests: write
steps:
  - run: gh pr merge "${{ github.event.pull_request.number }}" --auto --squash
    env:
      GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

How to prevent it

  • Prefer --auto so merges wait for required checks instead of failing.
  • Keep branch protection rules and workflow expectations aligned.

Frequently asked questions

What causes ""Pull request not mergeable""?
Branch protection requires status checks that have not completed.
How do I fix "Pull request not mergeable"?
Use auto-merge and satisfy protection

Related guides

References

Latchkey auto-heals failures like this one - detected, fixed, and retried without you. Start free → 30-day trial · No credit card