Skip to content

Repository files navigation

cortex-code-action

AI code review for data teams, powered by Cortex Code

License: MIT

A GitHub Action that uses Cortex Code to review your pull requests. Works for any codebase -- particularly useful for data engineering projects (SQL, dbt, Snowpark, Streamlit, Python pipelines).

Why

  • Security-first: SQL execution is permanently blocked. This action reviews code, it does not access your data. See docs/security.md.
  • Data-aware reviews: Cortex Code understands SQL patterns, dbt conventions, Snowpark idioms, and Streamlit apps out of the box.
  • Reuses your setup: The same Cortex Code CLI you use locally powers CI reviews. No separate model configuration.

Security at a glance

This action cannot execute SQL and cannot read sensitive files (~/.ssh, ~/.snowflake, .env, *.p8, credentials). These restrictions are enforced at runtime via the Cortex Code Agent SDK's canUseTool callback -- independent of prompts. No configuration can override them.

See docs/security.md for the full threat model and rationale.

Quick start

name: Cortex Code Reviewon:
pull_request:
types: [opened, synchronize]jobs:
review:
runs-on: ubuntu-latestpermissions:
contents: readpull-requests: writesteps:
- uses: actions/checkout@v4with:
fetch-depth: 0
- uses: anthu/cortex-code-action@v0.1.0with:
snowflake_private_key: ${{ secrets.SNOWFLAKE_PRIVATE_KEY }}snowflake_account: ${{ secrets.SNOWFLAKE_ACCOUNT }}snowflake_user: ${{ secrets.SNOWFLAKE_USER }}snowflake_role: "CODE_REVIEWER"

Tip: Create a dedicated low-privilege Snowflake service user for CI. It only needs SNOWFLAKE.CORTEX_USER database role -- no data access required.

Features

  • PR code review with structured feedback (summary, issues, suggestions, verdict)
  • @cortex mention interaction in PR comments
  • Auto-fix commits (opt-in via permissions: read-write)
  • Real-time progress tracking comment
  • Configurable per-project review instructions

Documentation

TopicDescription
docs/security.mdThreat model, full blocklist, canUseTool internals
docs/configuration.mdAll inputs, outputs, and secrets reference
docs/usage.mdModes, triggers, custom instructions
docs/auto-fix.mdRead-write mode and auto-fix commits
docs/architecture.mdHow the Agent SDK gate works
docs/troubleshooting.mdCommon errors and debugging
docs/comparison.mdvs claude-code-action, vs generic reviewers
docs/contributing.mdDev setup, testing, releasing

License

MIT © Anton Huck

About

AI code review for data teams, powered by Cortex Code

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages