I see that the command is being called in the logs but in GitHub it does not display the status.
[Set GitHub commit status (universal)] PENDING on repos [] (sha:47ccf20) with context:api
The webhook-url is working correctly and is notifying Jenkins of when to build.
I also have the GitHub server setup and test connection is working.
Any ideas about what I might be missing in the setup?
I followed the steps in this question but still not getting anything to show in github: Show current state of Jenkins build on GitHub repo
The Commit status API allows external services to mark commits with an error , failure , pending , or success state, which is then reflected in pull requests involving those commits.
if you're following the steps in the link you shared, you might have missed a critical step after step 9 (Set Github commit status) which is to select the second option in the Status result options in the What section as shown below:
This would allow you to send the default status messages (error, failed, success, pending) for each build. Selecting the first option would require you to manually define which status you want to send back (which is none by default and might explain why you're not receiving anything).
Also be sure to verify that your payload url in Webhook section on Github is configured correctly with your generated token. I think you've done that well anyway.
You can select Let me choose individual events to have more control over what Jenkins can send but be sure to make sure repo:status option is ticked. Hope that helps.
For debugging, Use below CLI command to check whether your access token is able to set the status in GitHub for any dummy_test PR.
curl "https://api.github.com/repos/[organization name]/[repo name]/statuses/[commit id]?access_token=[GitHub access token]" -H "Content-Type: application/json" -X POST -d "{\"state\": \"success\", \"description\": \"Build Successful \", \"target_url\": \"[jenkins job url]\", \"context\": \"[Job name]\" }"
PS: Remove square braces
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With