Overview
GitHub tools enable IncidentFox to search code, analyze PRs, and interact with CI/CD workflows.
Configuration
{
"tools": {
"github": {
"enabled": true,
"token": "vault://secrets/github-token",
"default_org": "acme-corp"
}
}
}
search_github_code
Search code across repositories.
Parameters:
| Parameter | Type | Required | Description |
|---|
query | string | Yes | Search query |
repo | string | No | Repository filter |
language | string | No | Language filter |
Example:
@incidentfox search for payment processing error handling
read_github_file
Read file contents from a repository.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository name |
path | string | Yes | File path |
ref | string | No | Branch/commit |
list_pull_requests
List PRs in a repository.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
state | string | No | open, closed, all |
base | string | No | Base branch |
get_pull_request
Get PR details.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
pr_number | int | Yes | PR number |
get_pr_diff
Get the diff for a PR.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
pr_number | int | Yes | PR number |
create_pull_request
Create a new PR.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
title | string | Yes | PR title |
body | string | Yes | PR description |
head | string | Yes | Head branch |
base | string | Yes | Base branch |
This tool requires write permissions and may be disabled by default.
list_issues
List repository issues.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
state | string | No | open, closed |
labels | string | No | Label filter |
Add comment to an issue.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
issue_number | int | Yes | Issue number |
body | string | Yes | Comment text |
get_workflow_runs
List workflow runs.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
workflow_id | string | No | Workflow file |
status | string | No | success, failure |
get_workflow_run_logs
Get logs from a workflow run.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
run_id | int | Yes | Run ID |
Example:
@incidentfox get logs from the failing GitHub Actions run
get_check_runs
Get check runs for a commit.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
ref | string | Yes | Commit SHA |
git_diff
Show changes between commits.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
base | string | Yes | Base ref |
head | string | Yes | Head ref |
git_blame
Show who changed what in a file.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
path | string | Yes | File path |
git_log
Show commit history.
Parameters:
| Parameter | Type | Required | Description |
|---|
repo | string | Yes | Repository |
path | string | No | File path |
since | string | No | Start date |
Use Cases
CI Failure Analysis
@incidentfox why is the build failing on PR #123?
IncidentFox will:
get_pull_request - Get PR details
get_check_runs - Find failing checks
get_workflow_run_logs - Get failure logs
get_pr_diff - Analyze code changes
- Correlate to identify root cause
Deployment Correlation
@incidentfox what changed in the payments service recently?
IncidentFox will:
list_pull_requests - Recent merged PRs
git_log - Recent commits
get_pr_diff - Changes in each PR
Code Investigation
@incidentfox find where database connections are configured
IncidentFox will:
search_github_code - Find relevant files
read_github_file - Read configuration
git_blame - Find who last changed it
Required Token Scopes
| Scope | Purpose |
|---|
repo | Read code, PRs, issues |
workflow | Access GitHub Actions |
write:discussion | Post comments |
Next Steps