0

To publish an npm package the version number in package.json is used. For it to succesfully publish a unique number must be added. Otherwise, in the Azure pipeline the build will give an error or warning and then it will not publish.

Is it possible to conditionally run the npm publish task which only runs if a certain tag is present in the commit?


A similar question has been asked on: https://learn.microsoft.com/en-us/azure/devops/pipelines/targets/npm?view=vsts&tabs=yaml

Spindle
  • 190
  • 3
  • 9
  • By default there isn't such a built-in feature, you may try writing your own extension or scripts to identify the tag and do actions accordingly. – Andy Li-MSFT Oct 09 '18 at 03:21
  • The above comment should be the answer probably. There's no default way to do what you want (that I found), but I've had success adding `- refs/tags/*` to my `trigger` list and then running a bash script which manually looks for git tags and reacts appropriately – ncthom91 Oct 09 '18 at 19:57
  • might be related: https://stackoverflow.com/questions/59608092/ – T.Todua Feb 24 '22 at 15:43

0 Answers0