GitHub Permissions Guide
Different Simili Bot deployment patterns require different GitHub permissions. This guide helps you understand what’s needed and how to set it up securely.Quick Reference
| Pattern | Pattern A | Pattern B | Pattern C |
|---|---|---|---|
| Single Repo | 1 | Multiple | Multiple |
| Token Type | Default | PAT/App | Default |
| Repo Scope | Current repo | All target repos | Own repo |
| Cross-repo transfer | N/A | ✅ | ❌ (needs PAT) |
| Permissions | Standard | Elevated | Standard |
| Setup Time | 2 min | 10 min | 2 min/repo |
Permission Requirements by Pattern
Pattern A: Single Repository
What’s needed:- Default
GITHUB_TOKEN(automatically provided) - Only needs access to current repository
- ✅ Read issues in current repo
- ✅ Post comments to issues
- ✅ Search issues in current repo only
- ✅ Index issues to Qdrant
- ❌ Access other repositories
- ❌ Transfer issues between repos
Pattern B: Centralized Multi-Repository
What’s needed:- Personal Access Token (PAT) OR GitHub App token
- Access to multiple repositories across organization
- Elevated scope:
repo(full control of private repositories)
- ✅ Read issues across all target repositories
- ✅ Post comments to any repository
- ✅ Create issues in other repositories
- ✅ Transfer issues between repositories
- ✅ Add labels to issues
- ✅ Close issues in other repositories
- ✅ Search across all configured repositories
Pattern C: Distributed Multi-Repository
What’s needed:- Default
GITHUB_TOKEN(automatically provided to each repo) - Shared Qdrant instance for cross-repo search
- Optional: PAT if you need cross-repo issue transfers
- ✅ Read issues in own repository
- ✅ Post comments to own repository
- ✅ Search across all repositories (via shared Qdrant)
- ✅ Index to shared Qdrant collection
- ❌ Transfer issues between repositories
- ✅ All of the above, plus:
- ✅ Transfer issues between repositories
- ✅ Create issues in other repositories
Token Types Explained
Default GITHUB_TOKEN
Automatically provided by GitHub Actions. Scoped to the current repository. Pros:- No setup required
- Automatically refreshed
- Secure (per-repo scope)
- Short-lived (1 hour)
- Can’t access other repositories
- Can’t transfer issues across repos
- Limited to current repo operations
- Pattern A (single repo)
- Pattern C (distributed, no cross-repo transfers)
Personal Access Token (PAT)
A token you create and manage. Classic PAT (Recommended for simplicity):-
Create PAT:
- Go to GitHub Settings → Developer settings → Personal access tokens → Tokens (classic)
- Click Generate new token
- Choose scopes (see below)
- Copy token (won’t be shown again)
-
Scopes for Pattern B:
-
Store securely:
- Add to repository secrets as
GITHUB_TOKEN_PAT - Add to organization secrets (preferred)
- Never commit to version control
- Add to repository secrets as
- Permanent (until revoked)
- Centrally managed
- Can be used across multiple repos/workflows
- Requires manual creation
- Manual rotation needed
- Higher security risk if exposed
- Pattern B (centralized multi-repo)
- When you need organization-wide access
- When GitHub Apps aren’t available
GitHub App Token
A token generated from a GitHub App installed on your organization. Pros:- More secure (app-specific permissions)
- Can be scoped to specific repositories
- Automatic token rotation
- Organization-managed
- Better for webhooks
- More complex to set up
- Requires GitHub App creation
- Requires app installation on target repos
- Pattern B with webhook triggers
- Large organizations with security requirements
- When you need fine-grained webhook permissions
Setup Instructions
PAT Setup for Pattern B
Step 1: Create Personal Access Token
- Go to https://github.com/settings/tokens
- Click Generate new token → Generate new token (classic)
- Enter token name:
SIMILI_BOT_PAT - Select expiration:
90 days(or your preference) - Select scopes:
- ✅
repo— Full control of private repositories - ✅
public_repo— Access to public repositories
- ✅
- Click Generate token
- Copy the token immediately (you won’t see it again)
Step 2: Add to Organization Secrets (Recommended)
- Go to your organization Settings → Secrets and variables → Actions
- Click New organization secret
- Name:
GITHUB_TOKEN_PAT - Value: [paste the token from Step 1]
- Grant access to: Select
simili-bot-controlrepository (or all) - Click Add secret
Step 3: Update Workflow
In your control repo workflow, use the organization secret:Step 4: Test
- Open an issue in a target repository
- Check control repo’s Actions tab
- Verify workflow processes the issue
- Verify comment appears on the issue
GitHub App Setup for Pattern B
Step 1: Create GitHub App
- Go to your organization Settings → Developer settings → GitHub Apps
- Click New GitHub App
- App name:
Simili Bot - Homepage URL:
https://github.com/your-org/simili-bot-control - Webhook URL: Leave blank (for now)
- Uncheck: “Webhook active”
Step 2: Configure Permissions
-
Repository permissions:
- Issues:
Read & write(to post comments) - Contents:
Read-only(to read config)
- Issues:
-
Subscribe to events:
- ✅ Issues
- ✅ Pull requests (optional)
- ✅ Issue comment (optional)
- Click Create GitHub App
Step 3: Generate Private Key
- Scroll down to Private keys
- Click Generate a private key
- This downloads a
.pemfile (keep it secure)
Step 4: Install App on Organization
- In GitHub App settings, click Install App
- Select your organization
- Choose All repositories or select specific ones
- Click Install
Step 5: Get App ID and Installation ID
- Go to app settings → About
- Note the App ID (e.g., 123456)
- Go to Installations (left sidebar)
- Note the Installation ID (e.g., 987654)
Step 6: Generate Access Token
You’ll need to programmatically generate tokens. Simili Bot handles this, but you need to provide: In your workflow, set these secrets:actions/create-github-app-token@v1
Step 7: Configure Webhook (Optional)
If using webhook triggering:- Go to GitHub App settings
- Check Webhook active
- Set Webhook URL to:
https://github.com/your-org/simili-bot-control/actions - Generate a Webhook secret
- Add to repository secrets:
WEBHOOK_SECRET
Organization Secrets Setup (All Patterns)
Shared organization secrets are available to all selected repositories, reducing duplication.For Pattern B:
For Pattern C:
- Go to organization Settings → Secrets and variables → Actions
- Click New organization secret
- Add each secret
- Set access level (all repos or selected)
- Repositories can use:
${{ secrets.ORG_QDRANT_API_KEY }}
Permission Scope Examples
Pattern A: Current Repo Only
Pattern B: Multiple Repos
Pattern C: Own Repo + Shared Qdrant
Security Best Practices
1. Minimize Token Scope
Use the smallest scope possible for what you need:2. Rotate PAT Regularly
- Set 90-day expiration on PATs
- Create new PAT before expiration
- Revoke old PAT
- Update secrets
3. Use Organization Secrets
4. Never Commit Secrets
5. Audit Token Usage
- Go to Settings → Personal access tokens
- Review last used date
- Revoke unused tokens
- Check for suspicious activity
6. Use GitHub App for Large Orgs
GitHub Apps are more secure than PATs:- Per-app tokens
- Automatic token rotation
- Repository-scoped installation
- Better audit logging
Troubleshooting
Issue: “Resource not accessible by integration”
Cause: Token doesn’t have permission for action Solution:- Verify token has correct scopes (see above)
- If using PAT, regenerate with
reposcope - If using GitHub App, verify it’s installed on target repos
- Check token hasn’t expired
Issue: “Bad credentials”
Cause: Token is invalid or expired Solution:- Verify token value is correct (no extra spaces)
- Check token hasn’t expired
- Regenerate token if expired
- Update secrets with new token
Issue: Workflow can’t access target repository
Cause: Token lacks permission for specific repo Solution (PAT):- Check PAT has
reposcope - Check user who created PAT has access to target repo
- If target repo is new, try accessing it manually first
- Go to app Installations
- Verify target repo is listed
- If not, reinstall app on that repo
Issue: Can’t post comments to other repos
Cause: Wrong permission scope Solution:- Verify token has write access to issues
- For PAT: ensure
reposcope includes write - For GitHub App: verify
Issues: Read & writepermission - Test manually: try posting comment to verify permissions
Permission Matrix Reference
What Each Token Type Can Do
| Action | Default Token | PAT | GitHub App |
|---|---|---|---|
| Read current repo | ✅ | ✅ | ✅ |
| Write current repo | ✅ | ✅ | ✅ |
| Read other repos | ❌ | ✅ | ✅* |
| Write other repos | ❌ | ✅ | ✅* |
| Read private repos | ❌ | ✅ | ✅* |
| Cross-repo transfer | ❌ | ✅ | ✅* |
Scope Requirements by Action
| Action | Required Scope |
|---|---|
| Read issues | repo or public_repo |
| Post comments | issues: write (part of repo) |
| Create issues | repo |
| Transfer issues | repo |
| Close issues | issues: write (part of repo) |
| Add labels | issues: write (part of repo) |
Next Steps
Choose Your Setup
Review which pattern needs which permissions
Pattern Setup Guides
Follow setup for your chosen pattern
Configuration Reference
Learn configuration options
FAQ
Q: Can I use the same PAT for multiple repositories?
A: Yes! This is actually recommended for Pattern B. One PAT can be stored in organization secrets and used across all repositories.Q: Do I need to rotate the default GITHUB_TOKEN?
A: No. The defaultGITHUB_TOKEN is automatically managed by GitHub and rotated with each workflow run.
Q: Is it safe to use organization secrets?
A: Yes. Organization secrets are encrypted and only accessible to selected repositories. Better than duplicating secrets in each repo.Q: Can I revoke a PAT immediately?
A: Yes. Go to Settings → Personal access tokens and click Delete. The token stops working immediately.Q: What if my PAT expires?
A: GitHub sends you a warning. Before it expires:- Create a new PAT
- Add new token to secrets
- Test with new token
- Revoke old token
Q: Is GitHub App more secure than PAT?
A: Generally yes, because:- Tokens are auto-rotated
- Permissions are app-specific
- Better audit trail
- Can be limited to specific repos