Using GitHub
Practical guide for working with GitHub repositories, issues, pull requests, and code through Fp Switchboard.
Quick Tips
Section titled “Quick Tips”- Always provide
ownerANDrepoparams (e.g.,owner:"octocat",repo:"hello-world") - Issues and PRs share the same number sequence per repository
- File content is returned decoded (not Base64)
- Use
shaparameter when updating files to prevent conflicts - Rate limit: 5,000 requests/hour, 30/minute for search
Common Gotchas
Section titled “Common Gotchas”Secret Detection Blocks Writes Critical
Section titled “Secret Detection Blocks Writes ”All write operations are scanned for secrets like API keys, tokens, and passwords. Operations are blocked if secrets are detected.
| Example | |
|---|---|
| Wrong | Committing a file containing ghp_abc123... or AWS keys |
| Correct | Remove all secrets; use environment variables instead |
Read-Only vs Full Access Critical
Section titled “Read-Only vs Full Access ”Users connect with either Read-only (default) or Full Access. Write operations fail in read-only mode. Suggest reconnecting with Full Access if write fails.
Issues and PRs Share Number Sequence Critical
Section titled “Issues and PRs Share Number Sequence ”Each repo has one number sequence shared between issues and PRs. Issue #5 might actually be a PR.
Always Specify owner/repo Critical
Section titled “Always Specify owner/repo ”Most GitHub tools require both owner (username or org) and repo name.
| Example | |
|---|---|
| Wrong | github_list_issues({repo: "my-app"}) |
| Correct | github_list_issues({owner: "octocat", repo: "hello-world"}) |
File Updates Require sha Important
Section titled “File Updates Require sha ”When updating a file, provide the sha of the current version to prevent conflicts.
| Example | |
|---|---|
| Wrong | github_update_file without sha |
| Correct | First github_get_file to get sha, then github_update_file with that sha |
Error: 409 Conflict - sha required
Multi-Step Patterns
Section titled “Multi-Step Patterns”Create Pull Request
Section titled “Create Pull Request”github_get_repoto get default branch namegithub_create_branchfrom default branchgithub_create_fileorgithub_update_filewith changesgithub_create_prfrom new branch to base branch
Code Review
Section titled “Code Review”github_get_prto see PR details and descriptiongithub_list_pr_filesto see changed filesgithub_get_filefor each file to review codegithub_create_pr_reviewwith approval or changes requested
Update File Safely
Section titled “Update File Safely”github_get_fileto get current content and sha- Modify content as needed
github_update_filewith new content and sha from step 1
ID Format Reference
Section titled “ID Format Reference”| ID Type | Format | Example |
|---|---|---|
| Repository | owner/repo | octocat/hello-world |
| Issue/PR Number | Integer | 42 |
| SHA | 40-char hex | a1b2c3d4e5f6... |
| Branch | String | main, feature/login |
| Gist ID | 20-char hex | aa5a315d61ae9438b18d |
Example Prompts
Section titled “Example Prompts”- “List open issues on the switchboard repo”
- “Create a branch called feature/new-api”
- “Show the contents of README.md”
- “Create a pull request from feature/login to main”
- “Search for issues labeled ‘bug’ in the project”
Rate Limits
Section titled “Rate Limits”| Endpoint | Limit |
|---|---|
| General API | 5,000/hour |
| Search API | 30/minute |
| Content creation | 80/minute |