githubjenkinsjenkins-pipelinejenkins-pluginsgithub-webhook

Jenkins with Github Trigger (Github Plugin): How to use other branch (aside from master/main)?


Description:

I am trying to have Github webhook to trigger my Jenkins job. I am successful in triggering the job using the Main branch but no success using other branches. I have a new branch called 'develop' but it does not trigger the job.

Current Setup:

In Jenkins, I am using Pipeline -> Pipeline Script from SCM.

Under SCM, My repository is defined and it can access Main branch pr

enter image description here

But when I change it to other branch like 'develop', It does not work.

Is there additional configuration to use other branches?


Solution

  • Apparently, the input is accepting Regular Expression. The initial specified branch is '*/master'. Therefore, I used '*/develop' to trigger my Jenkins job for develop branch