AlphornAlphorn Docs

GitHub App

Connect GitHub to Alphorn once and get pull request, issue, push, release, workflow, deployment, and security alert notifications (secret scanning, Dependabot, code scanning) from every selected repository - no per-repo webhooks. Includes the self-hosted GitHub App setup.

With the GitHub App you connect a GitHub account or organization once and pick its repositories on GitHub. Events from all selected repositories arrive in one Alphorn webhook. You don't set up a webhook per repository, and repositories you add later (or all of them, if you choose All repositories) are covered automatically.

Connect GitHub

  1. Open Webhooks, click the arrow next to Create webhook and choose GitHub repositories. Only project owners and admins can create webhooks.
  2. GitHub asks where to install the app. Pick your account or an organization, then All repositories or a selection.
  3. GitHub asks you to authorize Alphorn. Alphorn uses this once to confirm that you own the installation, and doesn't store the token: an installation on a personal account must be yours, an installation on an organization needs an owner of that organization. Read access to some of its repositories isn't enough, because the connection receives events from all of them.
  4. You land on the new webhook, named after the GitHub account (for example GitHub (octocat)). Link output channels there, as with any other webhook.

On the webhook page, choose which events become messages. Pull requests, reviews, review comments, issues, comments, secret scanning alerts, and security advisories are selected by default. Events you don't select are dropped before they are stored, so they don't count against your message quota.

GroupEventWhat triggers it
CodePushesCommits pushed to a branch, tags pushed
Branch or tag createdA branch or tag is created
Branch or tag deletedA branch or tag is deleted
ReleasesPublished, edited, or deleted releases
Commit commentsComments on a commit
Pull requestsPull requestsOpened, closed, merged, reopened, and other pull request actions
Pull request reviewsA review is submitted, edited, or dismissed
Pull request review commentsComments on the diff of a pull request
Issues and discussionsIssuesOpened, closed, edited, labeled, and other issue actions
Issue and pull request commentsComments in the conversation of an issue or pull request
DiscussionsDiscussions created, answered, closed, and other discussion actions
Discussion commentsComments on a discussion
CI/CDWorkflow runsGitHub Actions workflow runs
DeploymentsDeployment status changes (success, failure, error, ...)
Deployment approvalsA deployment waits for review, or a reviewer approves or rejects it
SecuritySecret scanning alertsA secret is detected, publicly leaked, reopened, or resolved
Dependabot alertsA vulnerable dependency is found, fixed, dismissed, or reintroduced
Code scanning alertsA code scanning alert is created, appears in a branch, is fixed, or dismissed
Security advisoriesA repository security advisory is reported or published
CommunityStarsSomeone stars or unstars a repository
ForksSomeone forks a repository

Priorities

Alphorn sets a priority (1-5) where the event calls for attention. All other events, including resolved, fixed, and dismissed alerts, carry no priority.

EventPriority
Secret scanning alert created, publicly leaked, or reopened5
Dependabot alert created, reopened, or reintroducedFrom the advisory severity: critical 5, high 4, medium 3, low 2
Code scanning alert created, reopened, or appeared in a branchFrom the security severity: critical 5, high 4, medium 3, low 2. Without one: error 4, warning 3, note 2
Security advisory reported4
Security advisory published3
Deployment status failure or error4
Deployment approval requested3
Failed workflow run4

Code scanning and secret scanning alerts need GitHub Advanced Security on private repositories (they are free on public repositories). Dependabot alerts are free on all repositories. Secret values are never part of the notification.

Messages are formatted like any other GitHub webhook (see Sources → GitHub) and tagged with github, the event name, and the repository name. Use these tags to route per repository or event type, for example Tags has any of my-repo for one channel and push for another. See Filtering.

Change repositories, disconnect

  • Repositories: click Manage repositories on the webhook page, or change the installation on GitHub under Settings → Applications → Installed GitHub Apps (for organizations: the organization's settings). No change in Alphorn is needed.
  • Disconnect: deleting the webhook in Alphorn removes the connection. The app stays installed on GitHub until you uninstall it there.
  • Uninstall on GitHub: Alphorn removes the webhook automatically. Its message history is kept.

An installation can be connected to one project at a time.

Self-hosted setup

On a self-hosted instance, you register your own GitHub App once. After that, every user of your instance can connect GitHub.

GitHub must reach your instance

GitHub delivers events over the internet to BETTER_AUTH_URL. An instance that is only reachable in your local network (for example a home lab behind NAT) needs a reverse proxy with a public hostname or a tunnel such as Cloudflare Tunnel. Use HTTPS.

1. Register the app

On GitHub, open Settings → Developer settings → GitHub Apps → New GitHub App. To let members of an organization manage it together, create it under the organization's settings instead.

Replace https://alphorn.example.com with your BETTER_AUTH_URL:

FieldValue
GitHub App nameAny unique name, e.g. Alphorn Example
Homepage URLhttps://alphorn.example.com
Callback URLhttps://alphorn.example.com/api/github/callback
Request user authorization (OAuth) during installationOff (Alphorn asks for authorization itself)
Setup URLhttps://alphorn.example.com/api/github/callback
Redirect on updateOn
Webhook: ActiveOn
Webhook URLhttps://alphorn.example.com/api/github/webhook
Webhook secretA random string, e.g. from openssl rand -hex 32

Repository permissions (all Read-only): Actions, Code scanning alerts, Contents, Dependabot alerts, Deployments, Discussions, Issues, Metadata, Pull requests, Repository security advisories, Secret scanning alerts.

Organization permissions: Members Read-only. Alphorn uses it to check that the person connecting an organization's installation is an owner of that organization.

Leave everything else at No access.

Subscribe to events: Code scanning alert, Commit comment, Create, Delete, Dependabot alert, Deployment review, Deployment status, Discussion, Discussion comment, Fork, Issue comment, Issues, Pull request, Pull request review, Pull request review comment, Push, Release, Repository advisory, Secret scanning alert, Star, Workflow run.

If you add permissions to an existing GitHub App, every account that installed it must accept the new permissions on GitHub before those events arrive.

Where can this GitHub App be installed? Choose Only on this account if you only connect your own repositories, or Any account if other GitHub users or organizations on your instance should connect theirs.

Click Create GitHub App.

2. Collect the credentials

On the app's settings page:

  • The app slug is the last part of the public link, e.g. alphorn-example in https://github.com/apps/alphorn-example.
  • Copy the Client ID.
  • Under Client secrets, click Generate a new client secret and copy it.

You don't need a private key.

3. Configure Alphorn

Add the values to your environment and restart Alphorn:

.env
GITHUB_APP_SLUG=alphorn-example
GITHUB_APP_CLIENT_ID=Iv23liExample
GITHUB_APP_CLIENT_SECRET=your-client-secret
GITHUB_APP_WEBHOOK_SECRET=the-webhook-secret-from-step-1

GitHub repositories appears in the menu next to Create webhook on the Webhooks page once all four are set.

If you route outgoing traffic through an egress proxy (EGRESS_PROXY_URL), allow github.com and api.github.com: Alphorn calls them while connecting.

These variables are separate from GITHUB_CLIENT_ID and GITHUB_CLIENT_SECRET, which enable sign-in with GitHub and belong to a different app.

VariableDescription
GITHUB_APP_SLUGSlug of the GitHub App, from its public link
GITHUB_APP_CLIENT_IDClient ID of the GitHub App
GITHUB_APP_CLIENT_SECRETA client secret of the GitHub App
GITHUB_APP_WEBHOOK_SECRETThe webhook secret set on the GitHub App. Alphorn rejects deliveries without a valid X-Hub-Signature-256 signature

Troubleshooting

Message or symptomCause
GitHub repositories is missing from the menuOne of the four variables is unset, or you aren't an owner or admin of the project
"The GitHub connection expired or was started from another project"More than 10 minutes passed between installing and authorizing, or you switched projects during the flow. Choose GitHub repositories again
"Your GitHub account doesn't own that installation"The GitHub account you authorized isn't the account the app is installed on. Sign in on GitHub with that account
"Only owners of the GitHub organization can connect its installation"Ask an owner of the organization to connect it. Self-hosted: also check that the app has the Members organization permission and that the organization accepted it
"This GitHub installation is already connected to another project"Delete the webhook in the other project first
No messages arriveCheck Recent Deliveries on the app's Advanced settings page on GitHub. 401 means the webhook secret doesn't match GITHUB_APP_WEBHOOK_SECRET. 202 with event not selected means the event isn't selected on the webhook page

On this page