Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automatically update npm version number during pull request

liamsteele January 28, 2018

I want to automatically increment a version number in my package.json as I merge in a pull request.

My plan is to have a custom field on the jira issue associated with the pull request that specifies major/minor/patch, then use ApplicationLinkService in a bitbucket plugin (RepositoryMergeCheck seems the most appropriate) to grab that value.

I then want to modify the commit before it gets merged into master. It should grab the package.json from the head of master and use that and the jira field to determine the new value. Once it merges into master, bamboo automatically builds and attempts to publish so I need the version number to be correct before then.

I know of CommandBuilder to run git commands, but I can't see how it would help.

Is it possible to do this? The two issues I have with my current method are:

  1. I couldn't find a way to modify the commit itself before it's merged in.
  2. I can't find a way to grab files from the branches (feature or master).

 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events