Failed to update GitHub PR using Jenkins GitHub Pull Request Builder

I am testing a local version of Jenkins. All in the latest possible version. I installed the GitHub Pull Request Builder, but I can not get it to report the build status back to GitHub and update the PR using SUCCESS, FAILURE or ERROR.

I have completed the following steps:

  • Jenkins Management> System Setup> Github Pull Request Builder: I added my credentials and successfully completed all the tests:
    • Check basic connection to GitHub -> works
    • Test permissions for the repository -> works
    • Testing adding a comment to Pull Request → works
    • Check update commit status → works

Then I created a new task with the following settings:

Screenshot Jenkins

However, I cannot get Jenkins to update GitHub PR when building at all. The string is correctly reported as success or failure in Jenkins, but nothing returns it to GitHub.

Please note that I create manually, and not through "Use github hooks to run the build." I guess it doesn't matter?

+5
source share
2 answers

This plugin will only take effect when using a trigger.

And I think that it works as you please, you do not want your manual programs to run in your github, it should only be added when the assembly is in response to the transfer request.

You should be able to test it by issuing a pull request yourself. In addition, here is what interests me.

+3
source

You should consider checking the instructions provided on the official page https://wiki.jenkins-ci.org/display/JENKINS/GitHub+pull+request+builder+plugin under "Creating a task:"

The decisive point is the correct setting of the "refspec" and "branch specifier" fields.

Under Advanced, set "refspec" to +refs/pull/*:refs/remotes/origin/pr/* In "Branch Specifier", enter ${sha1} or if you want to use the actual commit in the pull request, use ${ghprbActualCommit} 

The plugin is based on some parameters of the task, which you [possibly] do not provide when you start it manually.

0
source

Source: https://habr.com/ru/post/1245715/


All Articles