From 0e3b333071ef2f18f74a0f5e911573e44bea561b Mon Sep 17 00:00:00 2001 From: Fox_block Date: Sat, 14 Mar 2026 18:57:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=C3=972?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/ci/apply-version.mjs | 6 ------ scripts/ci/parse-commit.mjs | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/scripts/ci/apply-version.mjs b/scripts/ci/apply-version.mjs index 8370732..1e13004 100644 --- a/scripts/ci/apply-version.mjs +++ b/scripts/ci/apply-version.mjs @@ -9,12 +9,6 @@ if (!version) { process.exit(1) } -const semverRe = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/ -if (!semverRe.test(version)) { - process.stderr.write(`非法版本号:${version}\n`) - process.exit(1) -} - const pkgPath = path.join(process.cwd(), 'package.json') const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8')) pkg.version = version diff --git a/scripts/ci/parse-commit.mjs b/scripts/ci/parse-commit.mjs index cfacb09..c014e00 100644 --- a/scripts/ci/parse-commit.mjs +++ b/scripts/ci/parse-commit.mjs @@ -16,7 +16,7 @@ const message = String(rawMessage || '').trim() // 是否以 release: 开头 const isReleasePrefix = /^release:/i.test(message) -const semverRe = /\bv?(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?)\b/ +const semverRe = /\bv?(\S+)/ const versionMatch = message.match(semverRe) const version = versionMatch ? versionMatch[1] : ''