janinko / ghprb

github pull requests builder plugin for Jenkins
https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin
MIT License
370 stars 20 forks source link

How to make ghprb work with manually triggered job? #491

Closed dutor closed 6 years ago

dutor commented 6 years ago

I set the Branch Specifier to ${sha1} and it works well with PR. But when I manually triggered the job, the job failed since ${sha1} was empty.

What I expect is that, when I manually start the job, it runs against a default branch, e.g. origin/master. I have tried to set the branch specifier to something like ${sha1:-origin/master}, but it still did not work.

So, what should I do?

Thanks!

dutor commented 6 years ago

@DavidTanner Could you help me on this? Thanks !

DavidTanner commented 6 years ago

You would need to add the variables you want to use as job parameters and set them manually. If you build manually, then no other triggers are run, and GHPRB is just another trigger.

dutor commented 6 years ago

Very much appreciated. I added a string parameter sha1 with a default value master, it works.