Repository navigation
Description
Summary
The bootstrap branches step (.github/actions/github/jobs/org-bootstrap-repo/action.mjs, the BRANCHES block) creates only next and hotfixes from the default branch. It never creates the orphan badges branch that the coverage badge job pushes to, so every onboarded repo needs a manual step: create an empty parentless commit, then push it as badges. That step is easy to miss, and it regularly is: several onboarded repos have no badges branch today.
badges is already part of the flow everywhere else: it is in the org ruleset's allowed branch names (scripts/setup-org-rulesets.mjs), the ci.yml template excludes it via branches-ignore, and branch retention treats it as bot-managed. Only bootstrap doesn't create it.
Current behaviour
push-badge/action.mjscreates the branch lazily on its first run (git checkout --orphan), so a missing branch doesn't break the badge job by itself.- But the README badge points at a branch that doesn't exist until the first successful coverage run on the default branch. Until then the badge is broken, and whether a repo has the branch depends on whether someone did the manual step or CI happened to run.
Requested change
In the branches step, after next / hotfixes:
- If
refs/heads/badgesexists, note it and do nothing. Never reset it, since it holds badge history. - Otherwise create an orphan commit through the Git Data API: a tree with a placeholder (for example a short
README.mdsaying the branch is bot-managed), or an empty tree, and a commit withparents: []. ThenPOST /git/refsforrefs/heads/badges. Doing this through the API means the commit is signed for the bot App, the same way other bootstrap writes are. - Record it like the others (
branch.badges.created/branch.badges.existed) and honourdry_run. - Optionally, add a
badges_branchinput (defaultbadges) to mirrornext_branch/hotfixes_branch, and add an opt-out for repos withenable_coverage_badge: false.
Re-running bootstrap on already-onboarded repos would then backfill the branch across the fleet.
Activity
Shinrai commentedon Nov 1, 2026
#413: the bootstrap
branchesstep creates an orphanbadgesbranch through the Git Data API when it's missing, and leaves an existing one alone. It adds the inputsbadges_branch(defaultbadges) andcreate_badges_branch(defaulttrue). Re-running bootstrap will backfill the branch across the fleet.cldmv-bot commentedon Nov 1, 2026
Marked
status: implemented— resolved by #413, merged intonext. This issue closes automatically when that work ships to the default branch.release: v4.35.0 - scope the pre-commit check to staged files through…