0
votes

I'm trying to integrate Jenkins with a private repository on GitHub.

I have a Multibranch Pipeline job configured with github's SSH URL: [email protected]:user/repo.git. The GitHub plugin is also installed. On GitHub I added the webhook per-plugin documentation.

Now, whenever a change is pushed to the repo Jenkins logs the event, but not start a build.

My best guess is that it happens due to URL mismatch: the job has SSH url, but github seems to send HTTP URL (http://github.com/user/repo). I do not know how to verify or address it.

2
The URL is right. I believe the webhook is wrongly registered. Or no action is registered on commitAnirudh

2 Answers

1
votes

I have solved my problem by installing the Git Branch Source Plugin and setting up the GitHub source in the configuration.

0
votes

First check you are able to access git repo from command line like below,

ssh [email protected]:user/repo.git 

If it returns "Permanently added the RSA host key for IP address" . Then its fine else check for ssh key added in git.

If above step is correct then proceed to below task

in project url under Github Project in job config give htttp url ( ex : http://github.com/user/repo ).

in repository url under Source Code Management give git url ( ex : [email protected]:user/repo.git ).

For detailed info https://medium.com/@marc_best/trigger-a-jenkins-build-from-a-github-push-b922468ef1ae