Skip to content

Commit afc3901

Browse files
committed
chore(workflow): 更新工作流权限并修复版本号处理
- 添加 actions 写入权限以支持 workflow dispatch - 修复 git-cliff 版本号前缀处理逻辑 - 防止版本号重复发布检查机制优化
1 parent ad6b889 commit afc3901

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎.github/workflows/tag.yml‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414

1515
permissions:
1616
contents: write
17+
actions: write # gh workflow run dispatch Release 需要(仅 contents 不够)
1718

1819
jobs:
1920
tag:
@@ -45,6 +46,8 @@ jobs:
4546
if [ -z "$V" ]; then
4647
echo "无法确定版本号(可能是首个 tag,请显式填写 version)" && exit 1
4748
fi
49+
# git-cliff 部分版本输出带 v 前缀,统一剥掉防拼出 vv*
50+
V=${V#v}
4851
# 防 dedup:目标 tag 已存在则拒绝
4952
if git rev-parse "v$V" >/dev/null 2>&1; then
5053
echo "tag v$V 已存在,拒绝重复发版" && exit 1

0 commit comments

Comments
 (0)