Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Protect released v* tags with a tag ruleset

未关闭
#53 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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 a v* 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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

laywill/laywill.github.io 的其他 Issue

查看 laywill/laywill.github.io 的全部 Issue

相似的 Issue

更多 Release Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。