Lesstep
Forgejo · Gitea · Codeberg · merge when checks succeed · Checked October 24, 2026

Forgejo and Gitea: merge when checks succeed, refused or not merged

Sending merge_when_checks_succeed: true to the merge API (POST /api/v1/repos/OWNER/REPO/pulls/NUMBER/merge) asks the server to merge the pull request once its checks pass. The server answers 201 with an empty body when it has scheduled the merge. All of the following was checked on October 24, 2026 in the current source of both (routers/api/v1/repo/pull.go, services/pull/check.go, services/automerge/automerge.go, models/pull/automerge.go). For the answers to an ordinary merge, see why the merge was refused.

What scheduling skips, and what still refuses it

The server schedules the merge even when nothing is left to wait for.

When the scheduled merge happens

Cancelling it

DELETE /api/v1/repos/OWNER/REPO/pulls/NUMBER/merge answers 204 when it cancelled the scheduled merge, 404 when none is scheduled, and 403 user has no permission to cancel the scheduled auto merge when you did not schedule it and may not merge the pull request yourself.

What to do

Forgejo and Gitea pull requests in IntelliJ IDEA

Pull Request Inbox for Forgejo and Gitea, a plugin by Lesstep for JetBrains IDEs 2024.1 or later, shows a pull request's merge checks before you merge and merges the head commit you had on screen. While the checks still run, its Merge dialog offers to merge when the checks succeed, and says the pull request will be merged then when the server answers 201. From version 1.0.17, when the server refuses to schedule it (405), it no longer names approvals and failing checks, which a scheduled merge waits for: it says that the pull request must not be a work in progress or conflict, and that you must be allowed to merge into the branch. When a merge is already scheduled (409), it says that the earlier one stays; for a 500 with no message, that an open dependency blocks the pull request. From version 1.0.18, it checks before scheduling that the branch has not moved since you opened the pull request, and says so instead of scheduling; the Merge dialog and the notice after scheduling say that commits pushed until the checks pass are merged too, and that cancelling the schedule on the pull request's page stops it. Reading is free; approving, commenting and merging are Pro (US$1.50 a month, with a 30-day trial).

Forgejo, Gitea and Codeberg are names of their respective owners; IntelliJ IDEA is a trademark of JetBrains s.r.o. This page is not affiliated with or endorsed by the Forgejo project, Codeberg e.V., the Gitea project or JetBrains.

More: Forgejo and Gitea merge refused (405, 409) · Forgejo and Gitea required checks (missing, skipped, patterns) · Forgejo and Gitea branch update refused (403, 409, 422) · Forgejo and Gitea review refused (422) · 404 "The target couldn't be found." and "not found" · "token does not have at least one of required scope(s)" · Forgejo and Gitea search refused (400, 422) · Forgejo and Gitea pull request files (pages of 50, changed_files) · Forgejo and Gitea pull request plugins for IntelliJ IDEA, compared · 日本語