I currently have a Jenkins pipeline project listen for the creation of new tags via means of Refspec
However, this does not listen for normal commits that are pushed on branches.
I have tried to use this RefSpec +refs/tags/*:refs/remotes/origin/tags/* +refs/heads/*:refs/remotes/origin/* and set the branch specifier to ** followed by trying **/tags/* and **/heads/* but normal commits do not trigger the build. If I use two separate pipelines, I can get them working separately correctly (one only triggers for commits and the other only for new tags).
I am making use of the GitHub plugin and have GitHub hook trigger for GITScm polling enabled for the pipeline and have set up the webhook to Jenkins on GitHub. I am also using the Jenkinsfile from SCM approach.
Is it possible to have a single pipeline that can trigger builds on both new tags and normal commits?
Thanks
