1.8 KiB
1.8 KiB
Testing GitHub app auth
Step 1: Create and install a dummy GitHub app for testing with
Go to https://github.com/settings/apps/new
- Enter a name for the app (needs to be unique across GitHub).
- Set the required
homepage URLfield (can be any valid URL). - Under
Webhook, uncheck theActivecheckbox. - Click on
Repository permissionsunderPermissions, and setContentstoRead-only - Click on
Create GitHub Appat the bottom of the page. - You should be navigated to a new page with a
Registration successful. You must generate a private key in order to install your GitHub App.message. Click on thegenerate a private keylink, and then theGenerate a private keybutton, and save it somewhere; it will be used to test the app authentication. - Click on the
Install Apptab on the left, and then click onInstallon the right. - Select
Only select repositories, and pick any private repository that contains a "LICENSE" file (may need to be created beforehand).
Step 2: Export the necessary environment variables
The following environment variables are required to run the git-sync github app auth tests:
GITHUB_APP_PRIVATE_KEYGITHUB_APP_APPLICATION_IDGITHUB_APP_CLIENT_IDGITHUB_APP_INSTALLATION_IDGITHUB_APP_AUTH_TEST_REPO
GITHUB_APP_PRIVATE_KEY
Should have been saved when creating the app
GITHUB_APP_APPLICATION_ID
The value after "App ID" in the app's settings page
GITHUB_APP_CLIENT_ID
The value after "Client ID" in the app's settings page
GITHUB_APP_INSTALLATION_ID
Found in the URL of the app's installation page if you installed it to a repository: https://github.com/settings/installations/<installation_id>
GITHUB_APP_AUTH_TEST_REPO
Should be set to the repository that the github app is installed to.