fix: 修正CD错误 #29

Merged
7iwind merged 1 commits from feature/route into main 2026-07-26 23:56:11 +08:00
+3 -14
View File
@@ -53,23 +53,12 @@ jobs:
VERSION="$PR_BODY"
echo "Found version: $VERSION"
# 检查远端是否已有此标签
if git ls-remote --tags origin "$VERSION" 2>/dev/null | grep -q .; then
echo "Tag $VERSION already exists on remote, skipping push"
git tag "$VERSION" 2>/dev/null || true
echo "tag=$VERSION" >> "$GITHUB_OUTPUT"
exit 0
fi
# 创建并推送标签
# 创建本地标签(不推送远端)
# Gitea Create Release API 会自动在远端创建标签
git config user.email "ci@datarouter"
git config user.name "DataRouter CI"
git tag -a "$VERSION" -m "Release $VERSION"
git tag -a "$VERSION" -m "Release $VERSION" 2>/dev/null || true
echo "Created local tag: $VERSION"
# 使用 origin remote(actions/checkout 已配置好认证)
git push origin "$VERSION" 2>&1
echo "Pushed tag: $VERSION"
echo "tag=$VERSION" >> "$GITHUB_OUTPUT"
# ── 读取标签(已有标签 / auto-tag 创建的标签)──