chore: protect main and the release tags - #3
Merged
Conversation
main had no protection at all — a force-push or an accidental delete would have destroyed history on a repo that is now public and published. Three rulesets, split deliberately rather than bundled into one: main: no force-push, no deletion no bypass, not even the owner main: PR + green checks bypass: repository admin release tags are immutable no bypass, v* cannot move or be deleted The split is the point. Rewriting main is the only mistake here that destroys work rather than just making a mess, so it has no escape hatch. The PR rule does, because a solo maintainer cannot approve their own pull request and a hard gate would mean self-blocking or fake reviews — remove the bypass actor when there is a second maintainer. Tags are immutable because a published npm version is. v0.5.0 must keep pointing at the commit whose provenance attestation says it built resilix@0.5.0. Two checks are deliberately NOT required: Deploy to Pages and release are push-triggered only, so they never report on a pull request, and requiring a check that cannot run blocks every merge forever. Every rule was tested rather than assumed, which caught a bad test of my own: `git push --force` of a descendant commit is a fast-forward, not a force, so it proved nothing and pushed an empty commit to main. The real test is a rewind — `push --force origin/main~1:main` — which is correctly rejected. Deletion of main and of v0.5.0 are both rejected too. Also closes the stale Version Packages PR. It was built from the four changesets consumed manually during the 0.5.0 release, so it had gone conflicting and would have rolled package.json back to 0.2.0.
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.
Documents the three rulesets now guarding
mainandv*tags, and why they are split rather than bundled.Also the first change to go through the new PR flow, which is itself the test that the rules do not block ordinary work.