修改工作流分解版本后的方法&&优化配置用户信息

This commit is contained in:
2026-01-13 05:22:34 +00:00
parent a2f474e1ca
commit 7dc0f11e6c
2 changed files with 8 additions and 6 deletions

View File

@@ -33,8 +33,8 @@ jobs:
git config --global --add safe.directory /github/workspace
# 配置用户信息
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "devstar"
git config --global user.email "devstar@noreply.github.com"
- name: 自动递增版本号
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
@@ -43,8 +43,10 @@ jobs:
CURRENT_VERSION=$(jq -r '.version' package.json)
echo "当前版本: $CURRENT_VERSION"
# 分解版本号
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
# 分解版本号(使用 sh 兼容的语法)
MAJOR=$(echo "$CURRENT_VERSION" | cut -d'.' -f1)
MINOR=$(echo "$CURRENT_VERSION" | cut -d'.' -f2)
PATCH=$(echo "$CURRENT_VERSION" | cut -d'.' -f3)
# 递增补丁版本号
NEW_PATCH=$((PATCH + 1))

View File

@@ -2,7 +2,7 @@
"name": "devstar",
"displayName": "%displayName%",
"description": "%description%",
"version": "0.4.4",
"version": "0.5.1",
"keywords": [],
"publisher": "mengning",
"engines": {