Skip to content

feat(ci): Add Claude Code workflow - #1185

Open
AkhileshNegi wants to merge 1 commit into
mainfrom
ci/claude-code-github-action
Open

feat(ci): Add Claude Code workflow#1185
AkhileshNegi wants to merge 1 commit into
mainfrom
ci/claude-code-github-action

Conversation

@AkhileshNegi

@AkhileshNegi AkhileshNegi commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Issue

Closes #PLEASE_TYPE_ISSUE_NUMBER

Summary

  • Before: No automated workflow for reviews or interactive assistant.
  • Now: Introduces a workflow with two jobs: one for interactive assistance and one for automated review.
  • Jobs trigger on specific actions and utilize defined criteria for reviews.
  • Supports fetching PR details with a shallow checkout.

Checklist

Before submitting a pull request, please ensure that you mark these task.

  • Ran fastapi run --reload app/main.py or docker compose up in the repository root and test.
  • If you've fixed a bug or added code that is tested and has test cases.

Notes

  • ready-for-review is the same label CodeRabbit uses (.coderabbit.yaml), so labelling a PR now fires both reviewers. If that turns out to be noise, drop one — changing the label here is a one-line edit.
  • Cost: every trigger is a full agent run billed to the API key. concurrency with cancel-in-progress on the review job keeps a remove/re-add of the label from stacking runs.
  • Fork PRs: the pull_request trigger doesn't expose secrets to forks, so the review job silently no-ops there. Deliberate — pull_request_target would expose the key to untrusted code.
  • actions/checkout@v7 matches continuous-integration.yml (upstream's example is on v6).
  • The repo's Stop hook (wiki-update.sh) also applies to these runs. On the read-only review job it exits 0; on the claude job it will nudge for a docs/wiki/ update when the change is structural, which is the intended behaviour.
Original PR description

Issue

N/A — infra setup.

Summary

Adds .github/workflows/claude.yml with two jobs:

Job Trigger What it does
claude @claude in an issue body/title, a PR comment, or a review Interactive assistant — answers, or pushes a fix commit
review ready-for-review label added to a PR Automated review, posted as inline comments + one summary comment

The review job doesn't carry its own review criteria. It reads .claude/commands/pr-review.md from the checkout and follows it from "What to check" onward, so the bot review and a locally-run /pr-review apply the same conventions and output format. Updating the checklist updates both.

It skips that file's "Gather the diff" section (which assumes a local clone with full history) and uses gh pr diff / gh pr view instead — the checkout is fetch-depth: 1.

Before this can run

  • Install the Claude GitHub App on the ProjectTech4DevAI org — needs an org owner, not just repo admin.
  • Add ANTHROPIC_API_KEY as a repository (or org) Actions secret.

Until both are done, the jobs are inert — nothing else in CI is affected.

Notes

  • ready-for-review is the same label CodeRabbit uses (.coderabbit.yaml), so labelling a PR now fires both reviewers. If that turns out to be noise, drop one — changing the label here is a one-line edit.
  • Cost: every trigger is a full agent run billed to the API key. concurrency with cancel-in-progress on the review job keeps a remove/re-add of the label from stacking runs.
  • Fork PRs: the pull_request trigger doesn't expose secrets to forks, so the review job silently no-ops there. Deliberate — pull_request_target would expose the key to untrusted code.
  • actions/checkout@v7 matches continuous-integration.yml (upstream's example is on v6).
  • The repo's Stop hook (wiki-update.sh) also applies to these runs. On the read-only review job it exits 0; on the claude job it will nudge for a docs/wiki/ update when the change is structural, which is the intended behaviour.

Checklist

  • YAML validated (parses, both jobs present)
  • Ran fastapi run --reload app/main.py — N/A, CI-only change
  • Tests — N/A, no application code touched

Two jobs in one workflow:

- `claude` — responds to @claude mentions in issues, PR comments and reviews.
- `review` — auto-reviews a PR when the `ready-for-review` label is added,
  reusing the repo's own checklist in .claude/commands/pr-review.md so the
  bot review and the local /pr-review pass apply the same conventions.

Requires an ANTHROPIC_API_KEY repository secret and the Claude GitHub App
installed on the org.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • ready-for-review

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Team

Run ID: 4980f4d5-b173-49d1-9f57-aafe589ddbd2

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title ci: add Claude Code GitHub Action feat(ci): Add Claude Code workflow Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown

OpenAPI changes   ⚪ No API surface changes

Note

This PR does not modify the API contract.

main87cd15b3 · generated by oasdiff

@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant