Repository navigation
ci: protect release tags and release branches - #574
Merged
Merged
Conversation
Add two rulesets, both starting in evaluate mode: - protect-tags: on all tags, block creation, update, deletion and force-push for everyone except repo admins, and require names to match ^v\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$. Targeting all tags, not only v*, also keeps ad-hoc tags off the repo. - protect-release-branches: on release-* branches, the same rules as protect-main (no deletion or force-push, PR with 1 approval, stale approvals dismissed, build-and-test). Run go.yml on release-* branches too, so build-and-test reports on release-branch PRs and the required check can pass. Document the branch and tag naming rules in docs/rulesets.md. Part of #547.
rakyll
approved these changes
Nov 12, 2026
This was referenced Nov 16, 2026
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.
Summary
Adds two rulesets, both in
evaluatemode, so release refs can only change through the release process. Stacked on #573. Review only the top commit.Changes
.github/rulesets/protect-tags.json, on all tags:RepositoryRole5). Today that's @rakyll, who has cut every release so far, plus @mayawang and google-admin.^v\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$.~ALLrather than onlyv*, which also keeps ad-hoc tags off upstream. All 7 existing tags (v0.1.0–v0.3.1) already match the pattern..github/rulesets/protect-release-branches.json, onrefs/heads/release-*: the same rules asprotect-main(no deletion or force-push, PR with 1 approval, stale approvals dismissed,build-and-test), without a merge queue. Norelease-*branches exist yet.go.ymlnow also runs onpushandpull_requestforrelease-*. Otherwisebuild-and-testnever reports on release-branch PRs, and the required check can never pass.mainandrelease-X.Yare long-lived; tags arevX.Y.Z[-pre]). AGENTS.md is updated to match.Open questions
bypass_actors.release-*branches: this PR doesn't restrict creation. We could add acreationrule with an admin bypass.After merge (repo admin)
hack/apply-rulesets.sh. The new rulesets are created inevaluatemode."enforcement": "active"in a follow-up PR.delete_branch_on_merge).git branch --mergedfinds only 1 of the 62. Check PR state instead.Part of #547.