Prevent build on tagging repo

I have set up the following:

  • tag repo using npm migrate patch after build
  • push tagging back to master

This in turn triggers circle ci to run the build again since master changed (package.json was updated) as part of the tagging which in turn tags the repo. Infinite build loop.

Whats the best way to prevent/handle this?

Are you sure you want to push that back to master? Could you please give us more context about your workflow?

I would suggest having a separate branch, for example production, that has all the commits with tags applied to them, or, alternatively, push to a branch like develop and then make CircleCI push the tagged version of all the commits to master. Would that work for you?