I want to edit my package version when I make a merge on Gitlab. I try with Husky like that but it's not working.
{
"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\"",
}
}
And I try with Gitlab-CI like that
enable_merge:
stage: staging_deploy
only:
- staging
script:
- npm version minor
And I get an error message
$ 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!
I can't do it on local because branches staging and master are protected