I'm trying to build the CI/CD Pipeline for my project in VSTS. The tests, build and deployment flow is all fine and working as expected.
But I couldn't manage to commit the auto increased version number in the package.json to the github repo.
My steps on the VSTS agent are as per this image.
I wrote the following npm scripts in Increase Version Number step to increase the minor version number.
git config user.email "ttcgabc123@gmail.com"
git config user.name "ttcg"
npm version minor
git commit
git push origin master --tags
It does increase the version number from 0.2.0 to 0.3.0 but, it doesn't push the changes made back to my github repo and I couldn't manage to commit/push these changes.
Please see the output of the above step in VSTS build. On line no. 12, you can see the new version number.
I tried to use git remote add origin https://github.com/ttcg/react-workout-diary.git
, but it shows the error message fatal: remote origin already exists.
Could you please advise me how can I automate to increase the version number in my CI/CD pipeline?