Important: The app needs a public address to receive incoming webhooks. You will need to either deploy it somewhere or you can use ngrok.io to create a simple reverse proxy for the incoming requests.
You can use a free ngrok account but be aware that your ngrok forwarding address might/will change. A paid account that does not have this behaviour might be a better alternative for more intensive development.
However to make it work with a free account you can simply update the NEXTAUTH_URL
in the .env
and update the callback
and webhook
urls on your github app settings page https://github.com/settings/apps/name-of-your-app
A github app is needed for user authentication and github integration.
- Go to https://github.com/settings/apps and create a new app
- The app naming does not matter, but will be displayed to the end-user
- Add a callback to Identifying and authorizing users
- Set the callback url to:
https://<your public domain or localhost>/api/auth
- Set the callback url to:
- Activate the Webhook section and set the Webhook URL to
https://<publicly available domain>/api/github/events
- Set the following permissions
- Repository permissions:
- Actions: Read & Write
- Contents: Read-only
- Metadata: Read-only
- Workflows: Read & Write
- Organization permissions:
- Members: Read-only
- Account permissions:
- Email addresses: Read-only
- Repository permissions:
- Add the following in the Subscribe to events section
- Push
- Workflow Job
- Workflow Run
- Store the settings needed for the runtime environment
.env
file- Generate a new
Client secrets
and download thePrivate key
- Copy the
App ID
- Copy the
Client ID
- Generate a new
When you get a new ngrok url, you will need to replace the old url in your Github app and .env file. Here are the steps:
Edit your github app
Replace your new ngrok url with old on (remember to leave the subdirectories on both):
- Callback URL
- Webhook URL
In the .env
file:
Important! Replace the URLs of NEXTAUTH_URL
and BASE_URL
variable with your new url