Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 2.19 KB

File metadata and controls

86 lines (61 loc) · 2.19 KB

Usage Guide

Execution modes

The action supports three modes, auto-detected from the GitHub event by default.

Review mode

Triggered automatically on pull_request events (opened, synchronize).

Reviews the PR diff and posts structured feedback:

  • Summary: 2-3 sentence overall assessment
  • Issues: Specific problems with file references (critical vs minor)
  • Suggestions: Non-blocking improvement ideas
  • Verdict: Approved / Request Changes / Comment

Mention mode

Triggered when a PR comment contains the trigger_phrase (default: @cortex).

Examples:

@cortex what does this function do?
@cortex is this SQL query efficient?
@cortex can you suggest a better approach for this dbt model?

The action reads the comment, looks at the surrounding code, and replies in the same thread.

Fix mode

Triggered manually or via workflow dispatch when mode: fix is set and permissions: read-write. The agent reviews the diff and directly applies fixes for clear issues.

Trigger phrase customization

- uses: anthu/cortex-code-action@v0.1.0
  with:
    trigger_phrase: "@review-bot"
    # ...

Path-specific reviews

Use GitHub Actions paths: filter to trigger reviews only for certain files:

on:
  pull_request:
    types: [opened, synchronize]
    paths:
      - "models/**"
      - "*.sql"
      - "dbt_project.yml"

Custom review scope

Use prompt_file for stable, shared instructions committed to the repo:

prompt_file: |
  .github/instructions/base.md
  .github/instructions/dbt-rules.md

Use prompt for per-workflow inline instructions:

prompt: |
  Focus on:
  1. dbt model naming (snake_case, no reserved words)
  2. All models should have a primary key test
  3. No raw table references -- use source() or ref()

When both are set, files are read first, inline prompt is appended. See configuration.md for the full layering order.

Progress tracking

When track_progress: true (default), the action posts a sticky comment at the start of the review and updates it in real-time. The final review replaces this comment.

To disable:

track_progress: "false"