Here is a step-by-step guide to creating and configuring a GitHub App to use with the authentication mechanism.
- Go to your GitHub account (or Organization) Settings.
- On the left sidebar, scroll down and click Developer settings.
- Select GitHub Apps in the left sidebar, then click the New GitHub App button.
- Fill out the Register new GitHub App form:
- GitHub App name: Give it a recognizable name (e.g.,
HPCC ECL Fetcher). - Homepage URL: You can use your organization's URL or the HPCC platform repository URL (this is just required by the form).
- Webhook: Uncheck the Active checkbox. (HPCC only needs to pull code; it doesn't need to listen for GitHub events).
- GitHub App name: Give it a recognizable name (e.g.,
- Set the Repository permissions:
- Under Repository permissions, find Contents and set the access to Read-only. (This gives the app permission to perform
git fetch/git clone).
- Under Repository permissions, find Contents and set the access to Read-only. (This gives the app permission to perform
- Scroll to the bottom (Where can this GitHub App be installed?):
- Select Any account if you plan to fetch repositories owned by different organizations/users. Select Only on this account if you exclusively fetch repositories within your current organization.
- Click Create GitHub App.
Immediately after creating the app, you will land on its settings page. You need to collect three items to populate your HPCC secrets configuration:
- The App ID (
appid):- Look at the "About" section at the top of the page. Copy the App ID.
- The Private Key (
appkey):- Scroll down to the Private keys section.
- Click Generate a private key.
- This will download a
.pemfile to your computer. The entire contents of this file (including the-----BEGIN RSA PRIVATE KEY-----and end tags) will be yourappkeysecret.
The App ID and Private Key alone are not enough; the app must be installed on the target account/repository to generate the installationid.
- While still on the App's settings page, click Install App on the left sidebar.
- Click Install next to the user or organization account where the target ECL repositories live.
- Choose whether to install it on All repositories or Only select repositories, then click Install.
- You will be redirected to the installation settings page. Look at the URL in your browser's address bar. It will look like this:
https://github.com/settings/installations/12345678orhttps://github.com/organizations/YOUR_ORG/settings/installations/12345678 - Copy the numeric value at the end of the URL (e.g.,
12345678). This is your Installation ID (installationid).
-
configure the git user name to be x-access-token
-
Create a secret category "git", secret "x-access-token"
-
Place these three values highlighted above (
appid,appkey, andinstallationid) into your HPCC secret.