GitHub App Setup
fouine connects to GitHub as a GitHub App. This gives it per-repo access, webhook delivery, and the ability to post reviews.
Create the app
Go to GitHub Settings > Developer settings > GitHub Apps > New GitHub App
Fill in:
- GitHub App name:
fouine(or your preferred name) - Homepage URL: your server URL (e.g.
https://fouine.example.com) - Webhook URL:
https://your-server.com/webhook/github - Webhook secret: generate a random string and save it
- GitHub App name:
Set Repository permissions:
- Pull requests: Read & Write (to post comments and reviews)
- Contents: Read & Write (Read to clone repos; Write so the self-improvement loop can propose
REVIEW.mdupdates as a PR — Read alone works if you don't use it) - Issues: Read & Write (only needed for issue refinement/implementation — comment on issues with
/fouine refine//fouine implement)
Set Subscribe to events:
- Pull request
- Issue comment (for
/fouinetriggers) - Issues (only needed for issue refinement/implementation — auto-refine on issue opened, or auto-implement on
labeled, when the per-repo toggle is on) - Pull request review (merger: re-evaluate an armed PR once a review is submitted)
- Check run (merger: re-evaluate once a check completes)
- Check suite (merger: re-evaluate once a suite completes)
- Status (merger: re-evaluate once a commit status completes)
The last four are only needed for the merger — skip them if you don't use auto-merge.
Contents: write+Pull requests: write, set below, are all the permissions the merger needs; it does not useadministration:read, so it can't read branch protection and falls back to requiring every check on the head commit (see the merger guide).Under Where can this GitHub App be installed?, choose:
- Only on this account — for personal/org use
- Any account — if you want others to install it
Click Create GitHub App
Generate a private key
- On the app's settings page, scroll to Private keys
- Click Generate a private key
- A
.pemfile will download — save it to your server
Install the app
- On the app's settings page, click Install App
- Choose the account/org
- Select which repos to review (or all)
- Click Install
Configure fouine
Set these environment variables (or use the .env file):
| Variable | Value |
|---|---|
GITHUB_APP_ID | Found on the app's settings page |
GITHUB_APP_PRIVATE_KEY_PATH | Path to the .pem file |
GITHUB_WEBHOOK_SECRET | The secret you set during creation |
TIP
You can also use GITHUB_APP_PRIVATE_KEY with the key contents inline (literal \n are un-escaped). The *_PATH variant is recommended.
Webhook delivery
If your server is behind a reverse proxy or tunnel (ngrok, Cloudflare Tunnel), make sure the webhook URL is reachable from GitHub. You can test delivery from the app's Advanced > Recent Deliveries tab.
