Webux Lab

By Studio Webux

Setup Github app with Jenkins

TG
Tommy Gingras Studio Webux 2024-04-07

Building a GitHub App for Jenkins Integration

Embark on seamless Jenkins integration with GitHub using our quick and concise step-by-step guide. Unlock efficient development workflows effortlessly!

GitHub Configuration

  1. Visit https://github.com/settings/profile.
  2. Scroll down and navigate to Developer settings.
  3. Choose GitHub apps.
  4. Click on New GitHub app.
  5. Name your app as per your preference.
  6. Set the homepage URL as your Jenkins URL.
  7. Disable the webhook option.
  8. Define the Repository permissions: 8.1. Grant read-only access for Contents and Pull Requests. 8.2. Grant read/write access for Commit statuses and Packages. Of note, you cannot interact with packages using a github app (there is few Github Issues about that)
  9. Create the application.
  10. Note down the App ID (required for Jenkins).
  11. Generate a private key (to be used in Jenkins).
  12. Click Install app.
  13. Choose the organization(s) where you want to install the app (installation needs to be done per organization or enable it for any GitHub account).

Jenkins Configuration

  1. Create a new Jenkins credential of type GitHub app.
  2. Copy the App ID.
  3. Execute the following command: openssl pkcs8 -topk8 -nocrypt -in downloaded-key.pem, using the downloaded .pem file from GitHub.
  4. Paste the output into Jenkins.
  5. Test the connection.

That’s all there is to it!

Setting Up a Multibranch Pipeline

  1. Choose your GitHub credential.
  2. Configure the GitHub URL as usual.
  3. Initiate the scan.
  4. Everything should function smoothly, without the need to create a dummy GitHub user or share an API key.

Search