diff --git a/scripts/verify-commit-msg.js b/scripts/verify-commit-msg.js index 59b2255f..ddaa01f0 100644 --- a/scripts/verify-commit-msg.js +++ b/scripts/verify-commit-msg.js @@ -5,7 +5,7 @@ const msg = require('fs').readFileSync(msgPath, 'utf-8').trim() const commitRE = /^(revert: )?(feat|fix|polish|docs|style|refactor|perf|test|workflow|ci|chore|types|build|v)(\(.+\))?: .{1,50}/ -if (!commitRE.test(msg)) { +if (!/^v\d+\.\d+\.\d+/.test(msg) && !commitRE.test(msg)) { console.log() console.error(` ${chalk.bgRed.white(' ERROR ')} 无效的提交信息`) process.exit(1)