Skip to content

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

Open
AkhileshNegi wants to merge 2 commits into
mainfrom
ci/claude-code-github-action
Open

AkhileshNegi wants to merge 2 commits into
mainfrom
ci/claude-code-github-action

Conversation

@AkhileshNegi

@AkhileshNegi AkhileshNegi commented Sep 5, 2026 •

Copy link
Copy Markdown
Collaborator

Issue

N/A — infra setup.

Summary

Adds .github/workflows/claude.yml with two jobs. Nothing else in CI changes.

 .github/workflows/
 ├── continuous-integration.yml
 ├── ...
+└── claude.yml
+    ├── claude   # @claude mention in issue / PR comment / review → interactive assistant
+    └── review   # `ready-for-review` label added → automated review
sequenceDiagram
    participant Dev
    participant GitHub
    participant Action as claude-code-action
    participant Repo as .claude/commands/pr-review.md
    Dev->>GitHub: add label ready-for-review
    GitHub->>Action: pull_request[labeled]
    Action->>Repo: read "What to check" onward
    Action->>GitHub: gh pr diff / gh pr view
    Action-->>GitHub: inline comments + one summary comment
Loading

The review job carries no review criteria of its own. It reads .claude/commands/pr-review.md from the checkout, so the bot and a locally-run /pr-review apply the same checklist and output format. It skips that file's "Gather the diff" section (assumes full history) and uses gh pr diff / gh pr view instead — checkout is fetch-depth: 1.

Tools are allow-listed to create_inline_comment, gh pr comment, gh pr diff, gh pr view. Review-only — no file writes.

Before this can run

  • Install the Claude GitHub App on the ProjectTech4DevAI org (needs an org owner).
  • Add ANTHROPIC_API_KEY as a repository or org Actions secret.

Until both are done, both jobs are inert.

Evidence

  • Before: no claude.yml; @claude mentions and ready-for-review label do nothing.
    After: YAML parses, both jobs present:
    $ python -c "import yaml;print(list(yaml.safe_load(open('.github/workflows/claude.yml'))['jobs']))"
    ['claude', 'review']
    
    GitHub's own workflow validate check passes on this PR. Live end-to-end run blocked on the two setup items above.

Merge Danger

Door: two-way

Revert = delete one file. No app code, no migration, no secrets committed.

Blast Radius: CI-only

  • Cost: every trigger is a full agent run billed to the API key. concurrency + cancel-in-progress on review stops label remove/re-add from stacking runs.
  • Double review: ready-for-review is the same label CodeRabbit uses (.coderabbit.yaml), so one label fires both reviewers. If noisy, change the label here — one-line edit.
  • Fork PRs: pull_request doesn't expose secrets to forks, so review silently no-ops there. Deliberate — pull_request_target would hand the key to untrusted code.
  • claude job has contents: write — it can push fix commits when asked via @claude. Scoped to repo collaborators by the App's own auth.
  • actions/checkout@v7 matches continuous-integration.yml.
  • The repo Stop hook (wiki-update.sh) runs on these jobs too: exits 0 on review; on claude it nudges for a docs/wiki/ update when the change is structural (intended).

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
Contributor

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

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

main ↔ d3925147 · 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!

@Ayush8923 Ayush8923 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added few comments.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we implement an agent bot for this so that whenever it needs to comment on a PR or an issue, it does so through the respective PR/issue itself?

Comment on lines +59 to +72
PR NUMBER: ${{ github.event.pull_request.number }}

Review this PR against the repository's own review checklist.

1. Read `.claude/commands/pr-review.md` and follow it from the "What to check"
section onward, together with "How to write the comments" and "Output format".
2. Skip its "Gather the diff" section — that one assumes a local clone. Use
`gh pr diff` for the diff and `gh pr view` for the description and commits.
3. Read the full files at non-trivial change sites before judging them, and
check `docs/wiki/INDEX.md` for the touched module before claiming that a
helper, service, or entity does not already exist.

Post specific findings as inline comments citing path:line, and the summary as
a single top-level comment. Review only — do not modify files.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few points:

  1. we should also add type-safety rules so the agent checks for them as well. or maybe in the code-review command as well. otherwise, over time, any tends to start getting used everywhere.
  2. we should add some rules around code quality as well, such as keeping functions below a certain number of lines, following the DRY principle, and checking for unnecessary code duplication.

@AkhileshNegi AkhileshNegi self-assigned this Oct 28, 2026

This branch has not been deployed

No deployments
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.

2 participants