Does not commit bumped version number in package.json on Bitbucket pipelines
See original GitHub issueI am having trouble using this in Bitbucket pipeline. It is consistently committing the changelog witout committing the package.json and the bumped version number.(Resulting in the same release version each time). I tried:
- useing barebones configuration to call only
standard-version
without any flags. - adding the --commit-all and -a flag
- manually calling
git add package.json
inprecommit
andrelease
hook. - removed all hooks
It works perfectly in local environment, I am not sure what I am missing.
Version: 7.0.0
Release Commit:
Package.json
"scripts": {
"release": "standard-version --no-verify --prerelease beta"
},
...
"standard-version": {
"scripts": {
"postbump": "git add package.json",
"precommit": "echo \"[skip ci]\""
},
"skip": {
"tag": true
}
}
Bitbucket PIpeline
# Check our guides at https://confluence.atlassian.com/x/14UWN for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: node:10.15.3
pipelines:
default:
- step:
caches:
- node
script: # Modify the commands below to build your repository.
- echo "Hi"
branches:
master:
- step:
caches:
- node
script:
- npm install
- npm run release
- git push origin master
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:7
Top Results From Across the Web
Make Bitbucket pipeline use new package.json version after ...
The problem here is that the project is built using the old version number, not the one i bumped it to. So the...
Read more >Retaining build status after bumping version number in pipeline
Because the new version number is committed with [skip-ci], Bitbucket is not detecting the build status from the original merge.
Read more >Automate Versioning Using Bitbucket Pipelines (NodeJS)
The version number gets declared in multiple locations (package.json, environment variables, version tags, CI configurations, etc.).
Read more >Automated Versioning With CI/CD - Level Up Coding
I will use Bitbucket and Bitbucket Pipelines, but you can use any Git and CI/CD ... I will use bump2version to increase the...
Read more >Version Bump Prompt - JavaScript Dev Tools
Bump Without Prompting · Update the version number in package.json and package-lock.json · Run any npm version scripts ( preversion , version ,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Had the same issue with
.gitignore
, and to save some time for anyone else having this issue it was that our.gitignore
contained the rowbuild
to ignore the build folder.Bitbucket pipeline cloned the repo into
/opt/atlassian/pipelines/agent/build
. And the whole folder was ignored including thepackage.json
andpackage-lock.json
files.Hope it saves some time if anyone else has the same issue.
And this issue could possibly be closed? It would however be an good idea to have an warning message abut any ignored files.
Looks like a duplicate of
https://github.com/conventional-changelog/standard-version/issues/253