GitHub Action

GitHubAction

Automated, context-aware code reviews on every pull request. Drop into any GitHub repository in minutes.

Upcoming Feature • In Development

The gitcaptain/action@v1 marketplace runner is currently being finalized. In the meantime, you can enable automated PR reviews today by connecting your repository via GitHub Webhooks in your dashboard.

Open Dashboard
Action Specification (Preview)

Target CI/CD Workflow Preview

This workflow file will be available in .github/workflows/gitcaptain.yml once published to the GitHub Marketplace. You can review the target configuration and parameters below.

.github/workflows/gitcaptain.ymlYAML Workflow
name: GitCaptain Code Review

on:
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  review:
    name: AST Syntax & Risk Analysis
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
      checks: write

    steps:
      - name: Checkout Code
        uses: actions/checkout@v4

      - name: Run GitCaptain Review
        uses: gitcaptain/action@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          fail-on-risk: true
          complexity-threshold: 15
          languages: typescript,javascript,python,java
          comment-mode: both

See it in action: Pull Request Reviews

GitCaptain posts clear, actionable feedback directly on the lines that need attention.

GC
gitcaptain-botbotcommented just now
Review Note: Potential Resource Starvation
Warning • 2 dependent services affected
src/services/webhook-dispatcher.ts:L42-L48
@@ -42,4 +42,7 @@ export async function dispatchEvents(events: Event[]) {
- for (const ev of events) await sendHook(ev);
+ // Unbounded concurrent network requests
+ await Promise.all(events.map(ev => sendHook(ev)));

Why this matters: Calling Promise.all directly over an unbounded array of events can exhaust socket pools and file descriptors under burst traffic.

Suggested fix: Use a concurrency limiter (like p-limit) or chunk requests in batches of 5–10 to preserve system resources.

GitCaptain CI Check: Passed with 1 recommendationParsed in 140ms

Configuration & Action Flags

Customize parser behavior, cyclomatic thresholds, and commenting style via action arguments.

ParameterRequiredDefaultDescription
tokenYes${{ secrets.GITHUB_TOKEN }}GitHub token used to authenticate and post review annotations on the pull request.
fail-on-riskNofalseIf true, fails the check run when high-severity logic bugs or circular dependencies are found.
complexity-thresholdNo15Maximum allowable cyclomatic score per function before flagging a refactoring note.
languagesNoautoComma-separated target languages: typescript, javascript, python, java.
comment-modeNobothWhere comments are posted: inline (on changed lines), summary (PR overview), or both.

Zero friction for your team

Nobody on your team needs to install local CLI tools or manage keys. If they can open a PR, they get instant code reviews automatically.

Catch bugs before human review

Save senior engineering hours. GitCaptain spots missing edge cases and unhandled exceptions early so teammates can focus on architecture.

Enforce branch protection

Add GitCaptain as a required status check in GitHub repo settings to prevent high-risk regressions from silently merging into main.

Need Custom Rules or Private Runners?

For teams with specialized compliance requirements or high PR volumes, we support private VPC deployments, self-hosted runners, and custom linting rules.

Talk to Us