Protect released v* tags with a tag ruleset
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 75/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- git, github
- 领域
- release
调研方向
先从仓库 rulesets API 和提供的 gh api 命令开始,然后检查现有的 Protect main ruleset 以进行对比。创建一个匹配 refs/tags/v* 的 active tag ruleset,并验证其 ref 模式中没有多余的引号。完成的标准是:拒绝删除和强制更新 v* 标签,同时不影响非 v* 标签。
由索引模型根据 Issue 内容生成。
描述
Problem
v* tags are now the only path to a production deploy (#52), but nothing makes
a released tag immutable. There is no tag ruleset on this repo — the only
ruleset is Protect main, which targets branches.
So after v2.0.0 has built, passed every gate and deployed, the tag can be
deleted and re-pushed at a different commit:
git tag -d v2.0.0 && git push origin :refs/tags/v2.0.0
git tag v2.0.0 <any-commit> && git push origin v2.0.0
That re-runs the whole pipeline and deploys the new commit under a version
number that already means something else. The release history stops being a
record of what was shipped, and the github-pages environment's v* tag policy
happily allows it because the ref name is unchanged.
Proposed fix
Add a repository ruleset targeting tags:
- Target: tag, include pattern
v* - Rules:
deletion(block tag deletion),non_fast_forward(block force
updates) - Enforcement: active, no bypass actors
gh api repos/laywill/laywill.github.io/rulesets \
-X POST \
-f name='Protect release tags' \
-f target='tag' \
-f enforcement='active' \
-f 'conditions[ref_name][include][]=refs/tags/v*' \
-f 'conditions[ref_name][exclude][]' \
-f 'rules[][type]=deletion' \
-f 'rules[][type]=non_fast_forward'
Worth confirming the resulting conditions.ref_name.include reads back as
refs/tags/v* with no stray quote characters — a literal-quote pattern silently
matches nothing, which is how the github-pages tag policy and the main entry
in Protect main were both broken on first attempt.
Trade-off
Mistyped or premature tags become unfixable in place; the recovery is to burn the
version and tag the next one. That is the normal cost of immutable releases and
is cheap here — pre-release tags (v2.0.0-rc.N) run the full pipeline and skip
deploy, so a candidate can be exercised before the real tag is cut.
Acceptance criteria
- Tag ruleset exists, active, matching
refs/tags/v* -
git push origin :refs/tags/<test-tag>is rejected for av*tag - Force-updating an existing
v*tag is rejected - Non-
v*tags are unaffected
Related
- #25, #52 — the tag-gated release pipeline this protects
- 主要语言
- HTML
- 星标
- 0
- 派生
- 0
- 平均合并
- 10 小时 2 分钟
- 30 天内合并 PR
- 41
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
laywill/laywill.github.io 的其他 Issue
-
design
难度 2/5 1-3 小时 新手友好度 75/100
laywill/laywill.github.io#186 ·
维护者通常 1 天内回复
-
design
难度 2/5 1-3 小时 新手友好度 68/100
laywill/laywill.github.io#183 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 74/100
laywill/laywill.github.io#135 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
laywill/laywill.github.io#106 ·
维护者通常 1 天内回复
-
infra needs-william
难度 2/5 1-3 小时 新手友好度 82/100
laywill/laywill.github.io#35 · 1 条评论 ·
维护者通常 1 天内回复
查看 laywill/laywill.github.io 的全部 Issue
相似的 Issue
-
out-of-date
难度 1/5 1 小时以内 新手友好度 65/100
CachyOS/CachyOS-PKGBUILDS#1981 ·
维护者通常 1 天内回复
-
documentation misleading packaging small
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 86/100
finos/fluxnova-control-center#96 ·
维护者通常 4 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
adidshaft/grok-gadgets-linux-sdk#70 ·
维护者通常 1 天内回复