Repository navigation
Description
Summary
The new org-wide ruleset (org-wide required workflow & main protection, applied 2026-09-22 by #109) blocks the creation of refs/heads/main on every repo it targets, and its only bypass actor is the charly-auto-merge GitHub App. A brand-new repo therefore has no way to create its initial main: an operator push is rejected, the contents/git-data APIs are rejected, and branch rename is rejected. There is no documented bootstrap path.
This was found while landing a new integration (three brand-new repos: layer-qdrant, pod-qdrant, plugin-qdrant), all created 2026-09-22 16:28 — after the ruleset landed at 16:11.
Evidence (measured)
$ git push -u origin main
remote: error: GH013: Repository rule violations found for refs/heads/main.
remote: - Required workflow 'charly/pr-validator, charly/pr-validator' is not satisfied
remote: - Required status check "validate / validate" is expected.
remote: - Cannot create ref due to creations being restricted.
Also rejected: the contents API (PUT /contents/... → 409 same message), clone-with-auto_init (GitHub's own initial commit is ALSO blocked — repo stays empty, default_branch set but no ref), and branch rename (bootstrap → main → 422 "repository rules do not permit renaming branch").
Every repo created after the ruleset is affected:
$ gh repo list opencharly --limit 1000 --json name,createdAt,defaultBranchRef \
--jq '[.[]|select(.createdAt > "2026-09-22T14:11:00Z")]|.[]|"\(.createdAt) \(.name) main=\(.defaultBranchRef.name)"'
2026-09-22T16:58:35Z zz-test-bootstrap2 main=
2026-09-22T16:28:55Z plugin-qdrant main=
2026-09-22T16:28:52Z pod-qdrant main=
2026-09-22T16:28:48Z layer-qdrant main=
(No repo created after the ruleset has a main ref.)
Why it happens
scripts/org-ruleset.sh applies a single ruleset with creation + deletion + non_fast_forward + required_status_checks (context validate / validate) + the workflows rule, targeting refs/heads/main on ~ALL minus a small exclude list. do_not_enforce_on_create: false. The validate / validate check can only be produced by a workflow run that itself requires the workflow to exist on the default branch — a cycle for a repo that has no default-branch commit yet. The only bypass is the App, which is not reachable by a human/operator or by a repo that isn't yet in a workflow run.
Options (please pick)
- Exclude empty repos — add a rule condition or extend
discover_excludesso a repo with no default-branch ref is not targeted until itsmainexists. Cleanest, but needs GitHub to support "no ref" conditions (it does not directly) — likely needs a two-phase apply. - Operator bootstrap step — document a once-per-new-repo bootstrap: temporarily add the repo to the ruleset
excludelist, pushmain, remove the exclusion. Deterministic; keepsmainprotected afterwards. - App-bootstrap workflow — a reusable
workflow_dispatchinopencharly/.githubthat, given a repo name, mints thecharly-auto-mergeApp token and createsmainvia the git-data API. Matches the existingretire-per-repo-dispatchers.ymlpattern (same App, same reason: a protected-mainwrite needs the bypass actor).
Whichever is chosen, the fix belongs to the ruleset's owner (opencharly/.github); I have not touched the ruleset or its scripts.
Impact
- Three finished, live-proven repos (
layer-qdrant,pod-qdrant,plugin-qdrant) are blocked from having amainbranch, so no PR can be opened and nothing can land. Their work is preserved on each repo'sfeat/qdrant-integrationbranch. - Any future new repo in the org hits the same wall.
Activity
aitrawog commentedon Oct 5, 2026
RESOLVED — closed by merged #112.
opencharly/.github#112("bootstrap the initial main on empty org repos") statescloses opencharly/.github#111and merged 2026-09-22, adding the bootstrap path for the org ruleset'screationrule. The gap is fixed (not auto-closed).Agent: cleanup-superseded · session ses_ef2ca2adaffeWiEs7e1xAeOCUh
Assisted-by: OpenCode DeepSeek V4.1 Flash (analysed on a live system)