Skip to content

Auto-merge

Auto-merge #1465

Workflow file for this run

# Auto-merge — nobody is in the merge loop.
#
# Green, ready PRs merge themselves. The policy lives in ONE place for the
# whole fleet — bitbaum/fleet, scripts/ci/auto-merge-sweep.sh — and this file
# only says "run it, with these settings".
#
# This repo held one of the drifted local copies of that script, and the drift
# bit for real on 2026-08-31: the local copy word-splits REARM_WORKFLOWS on
# whitespace, this file passed 'ci.yml,publish.yml', so every sweep dispatched
# the literal workflow "ci.yml,publish.yml", failed, and main's tip never got a
# CI run — the next sweep then waited forever on "CI catching up". Four merges
# in a row needed a hand dispatch. The canonical workflow documents exactly
# this trap at its rearm_workflows input; adopting it deletes the copy that
# made the trap possible.
#
# The triggers stay here because they are genuinely per-repo: workflow_run
# must name the CI workflow exactly.
#
# To stop all of this: delete this file, or add a `hold` label to a PR.
name: Auto-merge
on:
workflow_run:
workflows: ['CI']
types: [completed]
schedule:
- cron: '*/10 * * * *'
workflow_dispatch: {}
# Declared on the CALLER as well as inside the reusable workflow: a called
# workflow's token is capped by what the caller grants, so relying on the
# callee's block alone can hand it a read-only token — and the sweep would then
# merge nothing while still exiting 0, which is indistinguishable from having
# nothing to merge.
permissions:
contents: write # merge the PR
pull-requests: write # read PR state, delete the branch
actions: write # dispatch the re-arm workflows
checks: read # statusCheckRollup — only load-bearing on private repos
statuses: read
jobs:
sweep:
uses: bitbaum/fleet/.github/workflows/auto-merge-sweep.yml@main
with:
base_branch: main
ci_workflow: ci.yml
# SPACE-separated: the sweep word-splits this. The comma version of this
# line is the exact bug this adoption fixes.
rearm_workflows: 'ci.yml publish.yml'