I am struggling a bit with setting a workflow for our npm repo publish and git work flow. I have implemented a solution as follows and I am not satisfied with it.
Developer --> ready to push to git --> npm version (i have a script that updates README.md with the changelog -- using sinopia which does not support changelog) --> commit and push --> accept and merge --> git ci pipeline --> builds, tests and publishes to npm repo.
The nit that I have is that if the developer forgets to version the repo then the pipeline fails. I can probably create a staging area in my git pipeline that will contain an updated README and version the repo as part of the git CI. But that does not feel right for several reasons. Mainly I would rather not pollute the GIT with dynamic changes to the source files.
So, to summarize. Is there a better way? Ideally, I would like to version the repo when the changes are ready to be accepted in GIT. But I am not sure how. BTW we are using gitlab.