> For AI agents: the complete documentation index is available at https://docs.hod.sh/llms.txt, the full documentation bundle is available at https://docs.hod.sh/llms-full.txt.

# GitHub

Hod runs as a GitHub App: pushes and pull requests start runs, each job shows as a check run, and "Re-run" on GitHub reruns it in Hod.

```sh
hod github setup --server https://ci.example.com [--github-org <org>]
```

This registers the App through GitHub's manifest flow, writes `github-app.pem` and `github-app.env` (the `HOD_GITHUB_*` settings for the server), and prints the link that installs the App on your repositories. GitHub must reach the server for webhooks; `--webhook-url` sends them to a relay instead. Pull requests from forks don't run yet.

With `HOD_GITHUB_CLIENT_SECRET` (in `github-app.env`; or `HOD_GITHUB_CLIENT_SECRET_FILE`), people can also sign in with GitHub through the App (see [Users and roles](https://docs.hod.sh/self-hosting/users.md)). An App made before sign-in existed needs the callback URL `<HOD_PUBLIC_URL>/login/github/callback` and a client secret, both set in its settings on GitHub, and the `members: read` organization permission, which sign-in needs to read org memberships and teams.
