cnb-rs repo tag
cnb-rs repo tag <subcommand>仓库 Git tag 管理子组。覆盖 tag CRUD + tag annotations 7 个端点。
子命令
- cnb-rs repo tag list — 列出 tag(alias
ls) - cnb-rs repo tag view — 查看 tag 详情(含指向 commit + GPG 验证)
- cnb-rs repo tag create — 创建 tag(缺省
--target取 HEAD) - cnb-rs repo tag delete — 删除 tag(alias
rm) - cnb-rs repo tag annotation — tag 元数据管理子子组(list / set / delete)
三种 "tag" 概念区分
cnb-rs 项目里有 3 个「tag」相关概念,不要混淆:
| 子组 | 是什么 | 端点前缀 |
|---|---|---|
repo tag(本组) | 源码仓库的 git tag(如 v1.2.0) | /-/git/tags/* |
repo tag annotation | git tag 上的元数据(key=value 键值对) | /-/git/tag-annotations/* |
release | Release 发布(基于 tag + 附件 + 发布说明) | /-/releases/* |
registry tag | 制品库镜像 tag(如 docker image :latest) | /-/registries/*/tags/* |
简化记忆:
- 想给某个 commit 打标记 →
repo tag create - 想发布带附件的 release →
release create(背后会自动创建 tag) - 想管 docker / npm 包的 tag →
registry tag
示例
bash
# 列出所有 tag
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag ls
# 看某个 tag 详情
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag view v0.12.1
# 打 lightweight tag 到 HEAD
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag create v0.13.0
# 打 annotated tag 到指定 commit
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag create v1.0.0-hotfix \
--target a3f2c1d --message "Backport fix #123"
# 删 tag
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag rm v0.0.1-test -y
# 给 tag 加元数据(如 builder / signing info)
cnb-rs --repo wwvo/cnb-rs/cnb-rs repo tag annotation set v0.12.1 \
builder=github-actions sbom=https://example.com/sbom.spdx.json