ghprb: Jenkins doesn't build branches when refspec has been defined

I have defined +refs/pull/*:refs/remotes/origin/pr/* as my refspec and ${sha1} as my branch to build.

Now this stops me from building my normal branches when something is pushed to them, how can this be fixed?

I tried setting multiple refspecs but it didn’t seem to work, maybe my syntax was wrong…

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Reactions: 2
  • Comments: 17 (1 by maintainers)

Commits related to this issue

Most upvoted comments

@ssbarnea It is possible, though awkward.

image

I also have triggers setup for Build when a change is pushed to GitHub and GitHub Pull Request Builder. Along with that you will need to have your GitHub webhooks setup, just like you would if you had two separate jobs.

for me it didn’t work jenkins starts a build when i commit to my branch 6.0.3 but with the commit hash from the master branch 😭

i use +refs/heads/*:refs/remotes/origin/* +refs/pull/*:refs/remotes/origin/pr/*

any idea? can anybody confirm this?

HI, I am trying to build a PR from jenkins, Where it works as expected on master branch. But I am trying to build same PR using different branch “abc”.

Kindly please help me how can i configure PR for “abc” branch.

Thanks, Gauthami

What you must do within section ‘Repositories’:

  1. specify Repository URL (and credentials if required) - this you have already done;
  2. click onto ‘Advanced’ and within appeared ‘Refspec’ field provide command “+refs/heads/branch_abc:refs/remotes/origin/branch_abc” - this will fetch remote branch into jenkins workspace;
  3. within field ‘Branch Specifier (blank for ‘any’)’ input command “refs/heads/branch_abc” - this tells jenkins to build the project from branch “branch_abc”.