如果从分支到主节点的合并有任何变化,我们需要语义发布来分析提交消息并增加发布版本。我们正在使用 Bitbucket scm。我们如何从分支合并到主控的过程,开发人员创建拉取请求,然后审阅者将进行审阅。如果一切正常,审阅者将选择squash commit并单击合并。我尝试mergePattern
在默认规则之上设置包含壁球提交标头。但是,语义释放似乎仍然忽略了壁球提交。
包.json
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.0",
"@angular/cli": "~9.1.0",
"@angular/compiler-cli": "~9.1.0",
"@angular/language-service": "~9.1.0",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"@semantic-release/changelog": "^5.0.0",
"@semantic-release/commit-analyzer": "^6.3.3",
"@semantic-release/exec": "^3.3.8",
"@semantic-release/git": "^7.0.18",
"@semantic-release/npm": "^5.3.5",
"@semantic-release/release-notes-generator": "^9.0.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"commitizen": "^4.2.2",
"cz-conventional-changelog": "^3.3.0",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.4.1",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~2.1.0",
"karma-jasmine": "~3.0.1",
"karma-jasmine-html-reporter": "^1.4.2",
"protractor": "~5.4.3",
"semantic-release": "^15.14.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~3.8.3"
},
"release": {
"branch": "master",
"repositoryUrl": "https://bitbucket.org/scm/owner/reponame.git",
"plugins": [
[
"@semantic-release/commit-analyzer",
{
"parserOpts": {
"mergePattern": "/^Merge .* in .* from ([^\/]*).* to master$/"
}
}
],
[
"@semantic-release/release-notes-generator",
{
}
],
"@semantic-release/npm",
[
"@semantic-release/changelog",
{
"changeLogFile": "CHANGELOG.md"
}
],
[
"@semantic-release/git",
{
"message": "chore(release): ${nextRelease.version}",
"assets": [
"CHANGELOG.md",
"package-lock.json",
"package.json"
]
}
],
"@semantic-release/exec"
],
"ci": "false"
}
来自 npx semantic-release --no-ci --debug 的输出
[11:21:18 am] [semantic-release] [@semantic-release/commit-analyzer] » i Analyzing commit: Merge pull request #45 in owner/reponame from feature3 to master
Squashed commit of the following:
commit ad116843ba59f3f114a3c44772a3b7294255308a
Author: Tommy <tommy@hotmail.com>
Date: Thu Dec 24 14:37:46 2020 +0800
feat(rel): added create new user function
commit 52b1b0f9b0795b36706b840fb8c3ac2f950fa133
Merge: 8a87691 02069cf
Author: Tommy <tommy@hotmail.com>
Date: Thu Dec 24 14:36:33 2020 +0800
Merge remote-tracking branch 'origin/master' into feature3
commit 8a8769126d11aa8e42726f4209736a4a51f9b7f6
Author: Tommy <tommy@hotmail.com>
Date: Thu Dec 24 12:13:00 2020 +0800
feat(rel): added amend user function
semantic-release:commit-analyzer Analyzing with default rules +14ms
[11:21:18 am] [semantic-release] [@semantic-release/commit-analyzer] » i The commit should not trigger a release