feat: adopt shared-checkout-pr, and let the protection check read - #11
Open
CartagoGit wants to merge 1 commit into
Open
feat: adopt shared-checkout-pr, and let the protection check read#11CartagoGit wants to merge 1 commit into
CartagoGit wants to merge 1 commit into
Conversation
Tanit's `develop` and `main` have been protected and requiring
`ci-summary` for a while, but its `delendai.config.json` carried no
`development` block — so the resolved policy still fell through the
legacy compatibility layer to `shared-direct`. The repository enforced
one model and the configuration described another.
It now selects `shared-checkout-pr` explicitly, with `ci-summary` as the
required check, 0 approvals on the integration branch and 1 on the
release branch: certified work integrates autonomously, promoting to a
release keeps a human in the loop. Resolved and validated against the
policy engine before committing — zero violations, `usesWipRefs: true`.
The `branch-protection` job has been failing on every run, and not
because the protection was wrong. It passed `github.token`, which cannot
read branch protection at all — that needs Administration: read. It now
prefers `BRANCH_PROTECTION_TOKEN`, a fine-grained READ-ONLY token, and
falls back to the default. Deliberately not an admin token: a check that
can rewrite the rules it verifies is not a check.
The script conflated three different outcomes, which is why the failure
was unreadable:
- 404 on `/protection` reported `required_status_checks.contexts
ausente`. It means the branch has NO rule, and saying it that way
sent a reader to fix a field inside a protection that does not
exist.
- 401/403 was reported as "GitHub rechazó la protección" — as though
the protection were wrong, when in fact nothing was read. It stays a
failure, because a check that could not verify a property cannot
certify it either, but it now names the cause and the remedy.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two things Tanit was missing to close the migration on its side.
The config described a different model than the repository enforced
developandmainhave been protected and requiringci-summaryfor a while, butdelendai.config.jsoncarried nodevelopmentblock — so the resolved policy fell through the legacy compatibility layer toshared-direct.It now selects
shared-checkout-prexplicitly:ci-summaryas the required check, 0 approvals on the integration branch and 1 on the release branch. Certified work integrates autonomously; promoting to a release keeps a human in the loop.Resolved and validated against the policy engine before committing:
The protection check could not read the protection
branch-protectionhas failed on every run, and not because anything was wrong with the protection. It passedgithub.token, which cannot read branch protection at all — that needsAdministration: read.It now prefers
BRANCH_PROTECTION_TOKEN, a fine-grained read-only token, falling back to the default. Deliberately not an admin token: a check that can rewrite the rules it verifies is not a check.The script also conflated three outcomes, which is why the failure was unreadable:
/protectionreportedrequired_status_checks.contexts ausente. It actually means the branch has no rule at all — the old wording sent a reader to fix a field inside a protection that does not exist.🤖 Generated with Claude Code