What does enabling auto-merge on a GitHub pull request do, and when is that option available?
answer
- A standing instruction, not a bypass
- One repository-level switch must be on first
- You commit to a merge method at arming time
- Drafts are excluded; unprivileged pushes cancel it
- Merges when required checks and approvals are satisfied
basics
~20 sAuto-merge tells GitHub to merge a pull request by itself, with a merge method you pick up front, as soon as every remaining requirement is satisfied. It requires the repository's Allow auto-merge setting and a pull request that is not yet mergeable.
solid answer
~50 sAuto-merge is a standing instruction: "merge this the moment it qualifies". When you enable it you choose the merge method — squash, merge commit or rebase — and GitHub performs the merge once the outstanding requirements are met, typically required approvals, required status checks and required conversation resolution. Preconditions worth naming: - The repository setting **Allow auto-merge** must be enabled. - You need write access, and the pull request must not be a draft. - It is offered when something is still outstanding; a pull request that already qualifies is simply merged normally. Auto-merge does not weaken any rule — it waits for the same gates a human would wait for. It is cancelled if someone disables it, if the pull request closes, or if a push arrives from someone without write access. In a repository that uses a merge queue, arming auto-merge adds the pull request to the queue rather than merging it directly.
go deeper
Know that auto-merge means GitHub merges the pull request for you once it qualifies, and that it never skips the checks or approvals the repository requires.
Explain the preconditions — the Allow auto-merge repository setting, write access, not a draft — and that the merge method is chosen when arming, not at merge time.
Demonstrate the operational angle: what cancels it, how stale approvals can let unreviewed commits merge, and why late unattended merges matter when merge triggers a deploy.
Weigh it as a delivery-flow decision: where auto-merge is safe, where a merge queue or deployment window should sit in front of it, and what check reliability it presupposes across the organisation.
## What it is for On a repository with slow or numerous required checks, the last hour of a pull request's life is usually a human refreshing the page waiting for a green tick. Auto-merge removes that wait. You approve the intent once, and GitHub executes the merge when the conditions are satisfied — which might be at three in the morning, after the last check finally finishes. ## Enabling it Three things must line up. First, a repository administrator must turn on **Allow auto-merge** in the repository's pull request settings; it is off by default. Second, you need write access to the repository. Third, the pull request must be in a state where auto-merge is meaningful: not a draft, and with at least one requirement still unmet — if everything already passes there is nothing to wait for and you simply merge. When you enable it, GitHub asks which merge method to use, restricted to the methods the repository allows, and lets you edit the resulting commit message up front. That is the moment your judgment is recorded; from then on the merge is mechanical. ## What it waits for Auto-merge waits for the repository's own gates. In practice that means required status checks reporting success, the required number of approving reviews, any required review from code owners, resolution of conversations if the repository requires it, and the absence of blocking states such as a requested change that has not been resolved. Auto-merge grants no exemptions: it is the same merge a person with the same permissions would perform, executed by GitHub on their behalf. If a required check fails, nothing merges. Auto-merge stays armed and simply keeps waiting, so a re-run that turns green later will still trigger the merge — which is convenient when a check is flaky and dangerous if you have stopped paying attention to the pull request. ## When it turns itself off The important cancellation to remember is that a push to the head branch by someone **without write access** disables auto-merge. The rationale is straightforward: the person who armed it consented to merging the code they had reviewed, and an unprivileged contributor pushing new commits afterwards changes what would be merged. Closing the pull request also clears it, and anyone with write access can disable it manually. ## Interaction with a merge queue Where a repository routes merges through a queue, enabling auto-merge does not bypass it. The pull request is added to the queue when it qualifies, and the queue's own mechanics decide when it lands. Conceptually auto-merge answers "should this merge without me", while the queue answers "in what order and against what other pending changes". ## Operational judgment Auto-merge is safest where required checks genuinely mean what they say. Two failure modes show up on real teams: - **Stale approval.** Auto-merge is armed, then someone with write access pushes further commits. Unless the repository dismisses stale approvals on new commits, the merge can proceed against code nobody re-read. That is a rule you set in branch protection, and auto-merge makes the consequence of *not* setting it visible. - **Silent late merges.** A change that lands hours later can surprise an on-call engineer. Teams that deploy on merge often pair auto-merge with a deployment window or a queue rather than letting arbitrary changes land unattended. The corresponding benefit is real: it removes babysitting, shortens the time between approval and delivery, and cuts the human error of merging the wrong pull request while tab-switching. ## How to answer Define it as a deferred merge with the method chosen up front, list the preconditions (repository setting, write access, not a draft, something still outstanding), state clearly that it enforces exactly the same requirements as a manual merge, and finish with the cancellation rules and the stale-approval caveat. That progression shows both the mechanism and the operational awareness an interviewer is checking for.
- A pull request has auto-merge enabled and a required check just failed. What happens?Nothing merges, and auto-merge stays armed. It grants no exemptions from required checks, so the pull request simply waits. If someone re-runs the check and it passes, the merge proceeds then — which is why flaky checks plus auto-merge can produce a merge long after everyone stopped watching.
- How can auto-merge end up merging code that nobody re-reviewed?If the repository does not dismiss stale approvals when new commits are pushed, a collaborator with write access can push after auto-merge is armed and the approval still counts. The fix is a protection rule that dismisses stale approvals on new pushes, not a change to auto-merge itself.
- Does auto-merge bypass a merge queue?No. In a repository that uses a merge queue, arming auto-merge results in the pull request being added to the queue once it qualifies, and the queue decides when it actually lands. Auto-merge expresses intent; the queue controls ordering and batching.
saying these in an interview costs you the question
- Says auto-merge skips required checks or approvals
- Thinks it can be enabled on a draft pull request
- Believes it merges instantly regardless of state
- Assumes the merge method is decided at merge time, not when arming
- Claims a failed check permanently cancels auto-merge