Smithy GitHub app
The GitHub app is required if you need to scan your GitHub repositories with Smithy. The GitHub app provides automatic events, which can trigger Smithy workflows via the GitHub trigger. This way Smithy can scan your code automatically when you update a branch, open or update a Pull Request.
Installation
1. Create the Application
You can check out this example application to see how it's set up.
-
Head to the organisation's settings for applications and click on
New GitHub App. -
Fill in the application with the following data:
GitHub App name:Webhook Local Dev - $YourNameHomepage URL:https://your-instance.smithy.securityWebhook Active: trueWebhook URL:https://your-instance.smithy.security/api/webhooks/githubWhere can this GitHub App be installed?: it should be enabled onOnly on this account
-
Subscribe to events:
Pull RequestsPushRegistry Packages
-
Customise the permissions as follows:
-
Repository Permissions: Enablereadpermissions on:ContentsMetadataPull RequestsPackages
-
Organisation Permissions: Enablereadpermissions on:Organization private registries
-
-
Save the configuration
-
Generate a private key:
- click on
Private keysin the main configuration - download the key
- add the key in the same secret note that you used before for the secret on Bitwarden. You can use
pbcopyorxclipfor this.
- click on
-
Optional - add an image for your app
-
Head to
Install Appand install it -
You are all set!
2. Ask your Smithy Admin to add the Webhook configuration to your instance
3. Configure Webhook Secrets
Head to the /secrets page on your instance and create two secrets:
GITHUB_APP_WEBHOOK_SECRET: paste the secret from the Smithy appGITHUB_APP_WEBHOOK_PRIVATE_KEY: paste the private key from the Smithy app