当我在 Gitlab 上进行合并时,我想编辑我的包版本。我像这样尝试使用赫斯基,但它不起作用。
{
"hooks":{
"pre-commit": "npm run lint:fix",
"post-merge": "(git-branch-is staging && npm version minor || git-branch-is master && npm version major) && git add . && git commit -m \"new version\"",
}
}
我像这样尝试使用 Gitlab-CI
enable_merge:
stage: staging_deploy
only:
- staging
script:
- npm version minor
我收到一条错误消息
$ npm version minor
v0.5.0
npm ERR! code 128
npm ERR! Command failed: git commit -m 0.5.0
npm ERR!
npm ERR! *** Please tell me who you are.
npm ERR!
npm ERR! Run
npm ERR!
我不能在本地做,因为分支 staging 和 master 受到保护