How to avoid Jenkins triggering on git commands within Jenkinsfile

Viewed 2199

Jenkins triggers whenever I push onto my remote branch. A pipeline is then run using my Jenkinsfile script.

Within the jenkinsfile I git push tags, this command however triggers Jenkins again and kicks off another build, which then in turn runs git push tags causing an infinite loop.

How can I avoid jenkins triggering on git commands within jenkinsfile?
I have spent over a week searching for a solution and nothing seems to be working, thank you.

3 Answers
Related