question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Does not commit bumped version number in package.json on Bitbucket pipelines

See original GitHub issue

I 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 in precommit and release hook.
  • removed all hooks

It works perfectly in local environment, I am not sure what I am missing.

Version: 7.0.0

Release Commit: image

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:open
  • Created 4 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

4reactions
fbergstrmcommented, Aug 23, 2021

Had the same issue with .gitignore, and to save some time for anyone else having this issue it was that our .gitignore contained the row build to ignore the build folder.

Bitbucket pipeline cloned the repo into /opt/atlassian/pipelines/agent/build. And the whole folder was ignored including the package.json and package-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.

0reactions
amoshydracommented, Sep 3, 2022
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found