GitHub App
Every Pages CMS instance needs its own GitHub App. It signs users in, reads and writes repositories, and receives webhooks that keep the cache fresh. The setup helper registers it for you.
Register
From your Pages CMS project:
npm run setup:github-appIt asks whether the app is for production or local development, then opens GitHub to create it. Run it on the same computer as your browser: GitHub hands the credentials back through a local callback. To preview the app without creating anything:
npm run setup:github-app -- --base-url cms.example.com --dry-runCredentials go to .env.local for local development and .env.production.local for production. Both are git-ignored.
Use separate apps for development and production, and never point a development instance at the production app.
In the GitHub App settings, turn off Expire user authorization tokens. Pages CMS automatically renews installation tokens. If a user token expires, the user must sign in again.
What it requests
Webhook events: push, delete, repository, installation_target and workflow_run. Webhooks are delivered to /api/webhook/github and verified with GITHUB_APP_WEBHOOK_SECRET.
Changing permissions later
When an app's permissions change, each installation's owner must approve the new permissions on GitHub. Until they do, features that depend on them won't work for that installation.