Integrations
GitHub
Connect GitHub for authentication, repository management, and pipeline operations. Required.
GitHub
GitHub serves two roles in GridWork HQ: authentication (via OAuth) and repository management (via personal access token). This is a required integration.
What It Does
- Authentication — GitHub OAuth is the only login method. The
ALLOWED_GITHUB_IDenv var restricts access to your account. - Repository tracking — the dashboard displays commit activity, deployment status, and repo health for your tracked repositories.
- Pipeline operations — the
buildpipeline creates repos, pushes code, and manages client sites through the GitHub API.
Setup
1. Create a GitHub OAuth App
- Go to github.com/settings/applications/new
- Fill in:
- Application name: GridWork HQ
- Homepage URL:
http://localhost:3000(or your production URL) - Authorization callback URL:
http://localhost:3000/api/auth/callback/github
- Click Register application
- Copy the Client ID and generate a Client Secret
2. Create a Personal Access Token
- Go to github.com/settings/tokens
- Select scopes:
repo,read:org - Generate and copy the token
3. Find Your GitHub User ID
Visit https://api.github.com/users/YOUR_USERNAME and copy the id field.
4. Configure Environment Variables
# In gridwork-hq/.env.local
GITHUB_ID=your-oauth-client-id
GITHUB_SECRET=your-oauth-client-secret
GITHUB_TOKEN=ghp_your-personal-access-token
GITHUB_ORG=your-org-or-username
ALLOWED_GITHUB_ID=12345678
TRACKED_REPOS=repo1,repo2,repo3Environment Variables
| Variable | Required | Purpose |
|---|---|---|
GITHUB_ID | Yes | OAuth App Client ID |
GITHUB_SECRET | Yes | OAuth App Client Secret |
GITHUB_TOKEN | Yes | Personal access token for API calls |
GITHUB_ORG | Yes | Organization or username for repo operations |
ALLOWED_GITHUB_ID | Yes | Numeric user ID — restricts dashboard login |
TRACKED_REPOS | No | Comma-separated repos shown on the dashboard |
Updating Callback URLs
If you move from local development to production:
- Go to your GitHub OAuth App settings
- Update the Homepage URL to your production URL
- Update the Authorization callback URL to
https://your-hq-url/api/auth/callback/github
The callback URL must match exactly, including the protocol and path.
Without This Integration
Without GitHub credentials, you cannot log in to the dashboard at all. GitHub OAuth is the sole authentication method.