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

Can't Trigger Job from Github webhook #490

Closed yiidtw closed 6 years ago

yiidtw commented 6 years ago

I've installed Jenkins 2.138 from a newly deployed CentOS 7 droplet yesterday. And I bumped into almost the same issues as described followed:

https://stackoverflow.com/questions/23906352/git-pullrequest-job-failed-couldnt-find-any-revision-to-build-verify-the-repo https://stackoverflow.com/questions/37200820/jenkins-how-to-set-build-status-on-github-commit

I thought it was fixed in 1.32.3 for security-170 as described here.

https://wiki.jenkins.io/display/JENKINS/Plugins+affected+by+fix+for+SECURITY-170

If I leave the branches to build as blank, I can successfully trigger jobs manually, and it can be done by polling the SCM. But it just can't trigger by PR.

And I can manually pass the Github Auth, and leave a message on PR in "Test adding comment to Pull Request".

I've been trouble shooting all day, any idea?

yiidtw commented 6 years ago

Sorry, it seems that I've only allow the push event in Github web hook setting, and it seems working after I selected to open Pull Request web hook.

yiidtw commented 6 years ago

I've configured my Jenkins with SSL certificate today, and tried to redo the same work with new Jenkins server address, but I fail.

The same problem still occurred, I still can't set ${sha1} and the test result from manually triggered can't comment on the issue system.

I've checked the setting of web hook on Github, and it has 200 return code when I tried to redeliver the payload over and over again.

yiidtw commented 6 years ago

It's me again...

And I found the root cause. It was because I was not able to add credential in the following path: [Management]->[Configuration]->[Github]->[Github Servers]->[Credentials].

I've solved this from the following descussion

https://stackoverflow.com/questions/36500729/jenkins-github-plugin-cant-choose-my-credentials

And I'm now able the get the web from Github. However, I still can set ${sha1} in Branch Specifier. I guess this issue could be closed again.