Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins job status on GitHub

Scenario: When a PR is created in GitHub, it will trigger a Jenkins Multibranch pipeline to execute CI for the fork and will post the Jenkins job status on GitHub PR page for that fork.

Jenkins job is getting triggered automatically with the help of GitHub personal access tokens and Webhook. But Jenkins job status is not shown/posted anywhere on GitHub. Getting below error:

"Could not update commit status, please check if your scan credentials belong to a member of the organization or a collaborator of the repository and repo:status scope is selected GitHub has been notified of this commit’s build result"

Tried to post status using "GitHub autostatus" plugin, as per console output, getting below:

Console output snippet

Tried ignoring GitHub Hooks problems and others. Note: I am admin of the repo, still facing this issue.

like image 313
user9931563 Avatar asked Jun 19 '18 17:06

user9931563


People also ask

How do I check my status on GitHub?

You can see the overall state of the last commit to a branch on your repository's branches page or in your repository's list of pull requests. If status checks are required for a repository, the required status checks must pass before you can merge your branch into the protected branch.

How do GitHub and Jenkins work together?

Your GitHub repository is integrated with your Jenkins project. With this Jenkins GitHub integration, you can now use any file found in the GitHub repository and trigger the Jenkins job to run with every code commit.


1 Answers

I'm the author of the Github Autostatus plugin.

I think the problem is that whichever user ID Jenkins is using to run the job needs to be added to your github repo as a collaborator. If you open "Configure" from the project in Jenkins representing your github org, you should have a user configured that has access to github, e.g.

enter image description here

That user needs access to your repo - the easiest way to do that is add them as a collaborator in github

like image 134
Jeff Pearce Avatar answered Oct 18 '22 19:10

Jeff Pearce