warden setup-app
Create a GitHub App via the manifest flow to enable Warden to post PR reviews and comments as a custom bot instead of GitHub Actions.Usage
What It Does
- Starts local server - Temporary server on
localhostto handle OAuth callback - Opens browser - Navigates to GitHub App creation page
- Creates app - You click “Create GitHub App” on GitHub
- Exchanges code - Receives OAuth code and exchanges for credentials
- Displays credentials - Shows App ID and Private Key to add to GitHub secrets
Options
Create the app under an organization instead of personal account
Local server port for OAuth callback
Callback timeout in seconds (5 minutes default)
Custom app name (default: “Warden”)
Don’t open browser automatically, print URL instead
Suppress non-error output
Force color output on or off
Permissions
The created GitHub App will request these permissions:- contents: write - Read files, resolve review threads
- pull_requests: write - Post review comments and annotations
- issues: write - Create and update issues
- checks: write - Create check runs
- metadata: read - Read repository metadata
Exit Codes
GitHub App created successfully
- Port already in use
- Network error
- GitHub API error
- User cancelled (Ctrl+C)
- Timeout waiting for callback
Complete Workflow
1. Run setup-app
2. Create app on GitHub
Your browser opens to GitHub’s app creation page with pre-filled manifest. Click “Create GitHub App”.3. Receive credentials
4. Install the app
Click the installation URL or go to Settings → GitHub Apps → Your App → Install App. Select repositories where Warden should run.5. Add secrets
Go to your repository Settings → Secrets and variables → Actions:-
New repository secret:
WARDEN_APP_ID- Value:
123456(from setup-app output)
- Value:
-
New repository secret:
WARDEN_PRIVATE_KEY- Value: Copy entire private key including
-----BEGIN/END-----lines
- Value: Copy entire private key including
6. Update workflow
Edit.github/workflows/warden.yml to use app credentials:
7. Test on a PR
Create or update a pull request. Warden will now post as your custom app:Benefits of GitHub Apps
vs GitHub Actions Token
Using a GitHub App instead ofGITHUB_TOKEN provides:
- Custom bot identity - Comments appear from your app, not “github-actions[bot]”
- Better attribution - Clear distinction between different automation tools
- Persistent identity - App identity remains constant across workflows
- Enhanced permissions - More granular control over permissions
Use Cases
- Multiple tools - Distinguish Warden from other CI tools
- Brand identity - Use custom app name and avatar
- Enterprise - Organization-level app management
Organization Apps
Create app under organization ownership:- Shared ownership across org
- Centralized management
- Install once, use across repos
Examples
Standard Setup
Organization App
Custom Name and Port
Headless Server
For remote servers without display:Extended Timeout
For slow connections or multi-step approval:Troubleshooting
Port Already in Use
Browser Didn’t Open
Timeout
Lost Credentials
If you lost the private key before saving it:- Go to Settings → Developer settings → GitHub Apps
- Click your app
- Scroll to Private keys
- Click Generate a private key
- Download the
.pemfile - Add contents to
WARDEN_PRIVATE_KEYsecret
App Created But Error Occurred
If the app was created but you got an error:Security Notes
- Private key - Keep the private key secret. Anyone with the key can act as your app.
- Scope - Only install the app on repositories that need it.
- Rotation - Regenerate the private key periodically for security.
- Secrets - Never commit
WARDEN_PRIVATE_KEYto your repository.
Related Commands
- warden init - Initialize Warden configuration
- warden - Run analysis