Repository navigation
Gate main on one ci-passed check, and script its protection - #2
Merged
Merged
Conversation
Pasteup is to carry the same branch ruleset as the sigrix-io public repositories, which requires a single aggregate check, `ci-passed`, rather than each job by name. The workflow gains that job, copied from sigrix-io/mullion: it runs after the test matrix whatever the outcome and fails if any leg failed or was cancelled, so changing the matrix never means editing the ruleset. scripts/protect-repo.sh applies, through `gh api`: - sigrix-io/mullion's "default-branch" ruleset: no deletion or force-push of the default branch; changes only through pull requests, with no approval required; merging needs `ci-passed` green from GitHub Actions and the branch up to date. Its bypass actor, a sigrix team, becomes repository admins in the same pull-request-only mode, since a personal repository has no teams. - The same merge settings as mullion, which differ from the defaults only by deleting branches once merged. - Dependabot alerts, and once the repository is public, private vulnerability reporting (which SECURITY.md points to), secret scanning and push protection. It is safe to re-run: the ruleset is updated in place. On GitHub Free a private repository cannot have rulesets, and the script says so and asks to be run again right after the repository goes public. Tested against a fake `gh` that serves canned API responses and runs the script's own jq filters: a private repository on Free (refused at creation and at listing), on a paid plan, a re-run after going public, a validation error, and no access. The ruleset sent equals mullion's except for the documented bypass change and the omitted default-valued review parameters. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01E6aBDEnU4vqKQ4F9cnJMrL
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.
Gets Pasteup ready for the same branch protection as the sigrix-io public repositories, before it goes public.
What changed
ci-passedcheck. This CI job is copied from sigrix-io/mullion. It runs after the test matrix whatever the outcome, and fails if any part of it failed or was cancelled. It's the one checkmainrequires, so changing the matrix never means editing the ruleset.scripts/protect-repo.shapplies the protection withgh api. It's safe to re-run, because it updates the existing ruleset instead of creating another.default-branchruleset.maincannot be deleted or force-pushed.ci-passedgreen from GitHub Actions and the branch up to date withmain.Differences from the sigrix ruleset
Order of operations
ci-passedexists before anything requires it.scripts/protect-repo.sh.Testing
actionlintpasses on the workflow, andshellcheckandbash -npass on the script.ghthat serves canned API responses and runs the script's own--jqfilters. Scenarios covered:ci-passedreports for the first time.🤖 Generated with Claude Code
https://claude.ai/code/session_01E6aBDEnU4vqKQ4F9cnJMrL
Generated by Claude Code