This plugin integrates Jenkins with Github projects.
The plugin currently has three major functionalities:
The Github plugin decorates Jenkins "Changes" pages to create links to your Github commit and issue pages. It adds a sidebar link that links back to the Github project page.
When creating a job, specify that is connects to git. Under "Github project", put in: email@example.com:Person/Project.git Under "Source Code Management" select Git, and put in firstname.lastname@example.org:Person/Project.git
This feature enables builds after post-receive hooks in your GitHub repositories
To be able to use this feature:
In this mode, you'll be responsible for registering the hook URLs to GitHub. Click the icon to see the URL in Jenkins that receives the post-commit POSTs. Just go to Step 3.
In this mode, Jenkins will automatically add/remove hook URLs to GitHub based on the project configuration in the background. You'll specify GitHub OAuth token so that Jenkins can login as you to do this.
Step 1. Go to the global configuration and add GitHub Server Config.
Step 2.1. Create your personal access token in GitHub.
Plugin can help you to do it with all required scopes. Go to Advanced -> Manage Additional GitHub Actions -> Convert Login and Password to token
You can create "Secret text" credentials with token in corresponding domain with login and password directly, or from username and password credentials.
Step 2.2. Select previously created "Secret Text" credentials with GitHub OAuth token.
Step 3. Once that configuration is done, go to the project config of each job you want triggered automatically and simply check "Build when a change is pushed to GitHub" under "Build Triggers". With this, every new push to the repository automatically triggers a new build.
Note that there's only one URL and it receives all post-receive POSTs for all your repositories. The server side of this URL is smart enough to figure out which projects need to be triggered, based on the submission.
This plugin requires that you have an HTTP URL reachable from GitHub, which means it's reachable from the whole internet. So it is implemented carefully with the possible malicious fake post-receive POSTS in mind. To cope with this, upon receiving a POST, Jenkins will talk to GitHub to ensure the push was actually made.
In case your Jenkins run inside the firewall and not directly reachable from the internet, this plugin lets you specify an arbitrary endpoint URL as an override in the automatic mode. The plugin will assume that you've set up reverse proxy or some other means so that the POST from GitHub will be routed to the Jenkins.
If you set this up but build aren't triggered, check the following things:
Each GitHub Server Config creates own GitHub client to interact with api. By default it uses cache (with 20MB limit) to speedup process of fetching data and reduce rate-limit consuming. You can change cache limit value in "Advanced" section of this config item. If you set 0, then this feature will be disabled for this (and only this) config.
Skip to end of metadata Go to start of metadata