Skip to main content

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"
    }
  }
}

Available Tools

Code Tools

search_github_code

Search code across repositories. Parameters:
ParameterTypeRequiredDescription
querystringYesSearch query
repostringNoRepository filter
languagestringNoLanguage filter
Example:
@incidentfox search for payment processing error handling

read_github_file

Read file contents from a repository. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository name
pathstringYesFile path
refstringNoBranch/commit

PR Tools

list_pull_requests

List PRs in a repository. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
statestringNoopen, closed, all
basestringNoBase branch

get_pull_request

Get PR details. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
pr_numberintYesPR number

get_pr_diff

Get the diff for a PR. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
pr_numberintYesPR number

create_pull_request

Create a new PR. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
titlestringYesPR title
bodystringYesPR description
headstringYesHead branch
basestringYesBase branch
This tool requires write permissions and may be disabled by default.

Issue Tools

list_issues

List repository issues. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
statestringNoopen, closed
labelsstringNoLabel filter

create_issue_comment

Add comment to an issue. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
issue_numberintYesIssue number
bodystringYesComment text

GitHub Actions Tools

get_workflow_runs

List workflow runs. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
workflow_idstringNoWorkflow file
statusstringNosuccess, failure

get_workflow_run_logs

Get logs from a workflow run. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
run_idintYesRun ID
Example:
@incidentfox get logs from the failing GitHub Actions run

get_check_runs

Get check runs for a commit. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
refstringYesCommit SHA

Git Tools

git_diff

Show changes between commits. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
basestringYesBase ref
headstringYesHead ref

git_blame

Show who changed what in a file. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
pathstringYesFile path

git_log

Show commit history. Parameters:
ParameterTypeRequiredDescription
repostringYesRepository
pathstringNoFile path
sincestringNoStart date

Use Cases

CI Failure Analysis

@incidentfox why is the build failing on PR #123?
IncidentFox will:
  1. get_pull_request - Get PR details
  2. get_check_runs - Find failing checks
  3. get_workflow_run_logs - Get failure logs
  4. get_pr_diff - Analyze code changes
  5. Correlate to identify root cause

Deployment Correlation

@incidentfox what changed in the payments service recently?
IncidentFox will:
  1. list_pull_requests - Recent merged PRs
  2. git_log - Recent commits
  3. get_pr_diff - Changes in each PR

Code Investigation

@incidentfox find where database connections are configured
IncidentFox will:
  1. search_github_code - Find relevant files
  2. read_github_file - Read configuration
  3. git_blame - Find who last changed it

Required Token Scopes

ScopePurpose
repoRead code, PRs, issues
workflowAccess GitHub Actions
write:discussionPost comments

Next Steps