Notice: This resource is no longer being actively maintained and as a result some information may be out of date or inaccurate. Please see for technical instructions or for support related concerns.
DEV@cloud » GitHub Commit Hooks HOWTO

GitHub Commit Hooks HOWTO

Last modified by Michael Neale on 2014/07/25 03:04

If you would like builds to start immediately after a commit, you can use GitHub post-commit hooks to ping Jenkins to queue up a build whenever someone pushes to your repository.

There are just a few steps needed:

  1. Install the GitHub plugin.
    • Go to Manage Jenkins -> Manage Plugins -> Available [tab]. 
    • Choose the github plugin, and click the "Install Button" at the bottom of the page. 
    • Once the plugin is installed, restart Jenkins as directed.
  2. Next, configure the GitHub plugin with your GitHub credentials if you would like the plugin to automatically setup commit hooks in repositories that you administer.  Select "Let Jenkins auto-manage hook URLs" and enter your GitHub credentials - generate an oauth token on your github account settings page first - and use that in the Oauth token field (this means you aren't entering in your github password - username is optional):


  3. Then, just edit your job configuration to enter your GitHub repository URL, Name and Email.

    Git Location Configuration

  4. Next, choose "Build when a change is pushed to GitHub" and press the Save button at the bottom of the page.

    GitHub Build Trigger Configuration

  5. Finally, do an initial build of your project.

Voila! Now, any push to a branch in your GitHub repository will result in a build of any jobs configured to follow that branch.

Next: You may also want to configure your private GitHub repositories for access by your DEV@Cloud Jenkins builds while you have GitHub open.

Also - if you are interested - you can also have github pull requests build and be validated as they come in - read on.

Alternative Configuration

If you would prefer not to enter your GitHub credentials, you can choose "Manually Manage Hook URLs" in step two, and then set up the commit hook manually for each repository you are monitoring with Jenkins.

To do this, go to your repository on, click the "Admin" button at the top of the page, and choose "Service Hooks". Then choose "Post-Receive URLs" and enter the url to your Jenkins instance's GitHub webhook which is "https://<domain-id>" and should be the same for every repository or job.


Created by Ryan Campbell on 2011/07/20 22:17