Reputation: 1399
I'm trying to restrict only the master branch to can trigger builds on my Jenkins Pipeline.
I already tried "Filter branches by name" and "Filter branches by regex" but nothing has worked.
Someone can help me please?
Thank you...
Upvotes: 0
Views: 2005
Reputation: 552
I also had same problem. And this saved me
To filter according to the payload 'ref' tag, optional filter is set in jenkins pipeline job.
Then applied optional filter on 'ref' variable, to allow only master branch
or expression could be simply
refs/heads/master
Now my jenkins job is triggering only when there is a commit to master
Upvotes: 1