The action supports three modes, auto-detected from the GitHub event by default.
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
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.
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.
- uses: anthu/cortex-code-action@v0.1.0
with:
trigger_phrase: "@review-bot"
# ...Use GitHub Actions paths: filter to trigger reviews only for certain files:
on:
pull_request:
types: [opened, synchronize]
paths:
- "models/**"
- "*.sql"
- "dbt_project.yml"Use prompt_file for stable, shared instructions committed to the repo:
prompt_file: |
.github/instructions/base.md
.github/instructions/dbt-rules.mdUse 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.
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"