Create the GitHub App
GitNotify needs one GitHub App for webhook delivery and user sign-in. Create it under the GitHub account or organisation that should own the app.
Basic settings
Section titled “Basic settings”Open GitHub's developer settings, choose New GitHub App, and use these values:
| Setting | Value |
|---|---|
| GitHub App name | A unique name, such as GitNotify for Example |
| Homepage URL | https://gitnotify.example.com |
| Callback URL | https://gitnotify.example.com/oauth/github |
| Request user authorization (OAuth) during installation | Off |
| Setup URL | https://gitnotify.example.com/connect/installed |
| Redirect on update | On |
| Webhook | Active |
| Webhook URL | https://gitnotify.example.com/github |
| Webhook secret | A new random secret, for example from openssl rand -hex 32 |
| Where can this GitHub App be installed? | Any account if you will install it on organisations or accounts other than the owner |
Leave Request user authorization (OAuth) during installation off. GitNotify starts user authorization from /github connect, /gitnotify connect, or /connect and binds that sign-in to a short-lived session in the chat platform. Keeping the option off also leaves the Setup URL available after an installation.
The Setup URL sends the user back to the pending repository picker when the installation started there. Otherwise it tells them which chat command to run next.
Permissions
Section titled “Permissions”Under Repository permissions, set:
| Permission | Access |
|---|---|
| Actions | Read-only |
| Pull requests | Read-only |
Leave every other repository, organisation, and account permission at No access. GitHub adds read access to repository metadata automatically.
Under Subscribe to events, select these four repository events:
- Pull request
- Pull request review
- Workflow job
- Workflow run
The webhook handler reads these event names:
X-GitHub-Event |
Use |
|---|---|
ping |
Confirms that the webhook endpoint is reachable and signed correctly |
pull_request |
Updates pull request cards and review state |
pull_request_review |
Updates approvals, requested changes, and notifications |
workflow_run |
Updates CI and deploy runs and incidents |
workflow_job |
Adds job and failed-step details to runs |
installation |
Applies install, suspend, unsuspend, permission acceptance, and deletion changes |
installation_repositories |
Removes routes when repositories are removed from an installation |
github_app_authorization |
Removes a person's links after they revoke GitHub App authorization |
GitHub App lifecycle and authorization deliveries use the same webhook. The four repository events above are the event subscriptions you choose in the app settings.
Set the environment
Section titled “Set the environment”Copy these values from the GitHub App settings:
GITHUB_APP_SLUG=gitnotify-for-exampleGITHUB_APP_CLIENT_ID=Iv1.exampleGITHUB_APP_CLIENT_SECRET=replace-with-the-client-secretGITHUB_WEBHOOK_SECRET=replace-with-the-webhook-secretGITHUB_APP_SLUGis the final part of the app URL, such asgithub.com/apps/gitnotify-for-example.GITHUB_APP_CLIENT_IDis the app's client ID, not its numeric app ID.- Generate a client secret and use it as
GITHUB_APP_CLIENT_SECRET. - Use the same webhook secret in GitHub and
GITHUB_WEBHOOK_SECRET.
Apply the change with docker compose -f selfhosted/docker-compose.yml up -d gitnotify. Open the app's Advanced page and redeliver its ping delivery if you need to test the webhook again.
Install the app
Section titled “Install the app”Install the GitHub App on each account or organisation that owns repositories you want to connect. Choose all repositories or selected repositories according to your own access policy.
GitNotify only offers a repository when both conditions are true:
- The GitHub App is installed for that repository.
- The person who followed the chat sign-in link has repository admin permission.
The user token is used once to read their GitHub identity and eligible installations, then revoked after the connection or link is recorded.