feat(merge-queue): add action serializing merges of queued PRs #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/merge-queue"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds a
merge-queuecomposite action that serializes merges of labelled PRs on top of the existing repository rules (rebase-merge style, "block merge if outdated", required checks).Each run advances the queue by one step. The queue is the open PRs targeting the default branch that carry the
queuelabel, oldest first. The head of the queue is rebased on the base branch through the API when it is outdated, then scheduled with "merge when checks succeed". A head whose rebase conflicts, whose checks failed or whose merge Forgejo refuses is removed from the queue with a comment, and the next PR is tried. Calls that fail for reasons unrelated to one PR (auth, network) fail the job instead of draining the queue.Usage, in
.forgejo/workflows/merge-queue.yml:The token must be a personal access token (repository and issue read/write): the rebase it pushes has to trigger the PR checks. The schedule is what dequeues a PR whose checks failed, since no event fires on check completion.
Verified end to end on a sandbox repository (Forgejo 15.0.10, runner image with jq 1.6) with the same branch protection as the other repositories: