PluginsGitHub
Get Credentials
Step-by-step instructions for obtaining GitHub credentials
This guide walks you through obtaining all required credentials for the GitHub plugin.
Authentication Methods
The GitHub plugin supports both API key (Personal Access Token) and OAuth 2.0 authentication methods.
api_key- Personal Access Token authenticationoauth_2- OAuth App authentication
API Key Authentication (Personal Access Token)
Step 1: Create Personal Access Token
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click Generate new token → Generate new token (classic)
- Give your token a descriptive name
- Set an expiration (or select "No expiration" for long-lived tokens)
- Select the required scopes:
repo- Full control of private repositoriesread:org- Read org and team membershipread:user- Read user profile dataworkflow- Update GitHub Action workflows- Add any other scopes your application needs
- Click Generate token
- Important: Copy the token immediately - you won't be able to see it again
- Store the token securely
Storing Credentials:
Store the token with the Corsair CLI:
pnpm corsair setup --github api_key=your-personal-access-tokenVerify it was saved:
pnpm corsair auth --plugin=github --credentialsOAuth 2.0 Authentication
Step 1: Register OAuth App
- Go to GitHub Settings → Developer settings → OAuth Apps
- Click New OAuth App
- Fill in the application details:
- Application name: Your app name
- Homepage URL: Your application URL
- Authorization callback URL: Your OAuth callback URL (e.g.,
https://yourapp.com/auth/github/callback)
- Click Register application
Step 2: Get Client Credentials
- After registration, you'll see your Client ID
- Click Generate a new client secret
- Copy the Client ID and Client Secret
- Store these securely
Storing Credentials:
Store your OAuth app credentials, then start the flow:
pnpm corsair setup --github client_id=your-client-id client_secret=your-client-secret
pnpm corsair auth --plugin=githubThe CLI prints an authorization URL — open it in a browser. Once you approve, tokens are saved automatically.
To verify credentials were stored:
pnpm corsair auth --plugin=github --credentialsWebhook Secret
Step 1: Create Webhook
- Go to your repository on GitHub
- Navigate to Settings → Webhooks
- Click Add webhook
- Configure the webhook:
- Payload URL: Your webhook endpoint (e.g.,
https://yourapp.com/api/webhook) - Content type:
application/json - Secret: Generate a random secret string (save this)
- Events: Select the events you want to receive:
- Pull requests
- Pushes
- Issues
- Stars
- Releases
- Payload URL: Your webhook endpoint (e.g.,
- Click Add webhook
Step 2: Store Webhook Secret
Copy the secret you generated and store it using the CLI:
pnpm corsair setup --github webhook_signature=your-webhook-secretRequired Credentials Summary
| Credential | Required For | Where to Find |
|---|---|---|
| Personal Access Token | API Key auth | Settings → Developer settings → Personal access tokens |
| Client ID | OAuth 2.0 | Settings → Developer settings → OAuth Apps |
| Client Secret | OAuth 2.0 | Settings → Developer settings → OAuth Apps |
| Webhook Secret | Webhooks | Repository Settings → Webhooks → Secret |
For general information about how Corsair handles authentication, see Authentication.