nx/.github/workflows/claude.yml
Jason Jean f02cc49b06
feat(repo): enhance Claude Code workflow and settings (#31405)
## Current Behavior

The Claude Code setup has basic workflow automation but lacks
comprehensive tooling permissions and detailed guidance for issue
management. The workflow documentation contains redundant sections and
some outdated commands.

## Expected Behavior

With these changes, the Claude Code integration will have:
- Enhanced tool permissions for better CI/CD workflow support
- Comprehensive GitHub CLI commands for efficient multi-issue management
- Clear mandatory requirements for PR template completion
- Streamlined documentation with accurate command references

## Related Issue(s)

This PR builds upon the initial Claude Code setup from #31380 by
refining the workflow configuration and improving the developer
experience.
2025-05-30 21:26:52 -04:00

94 lines
2.8 KiB
YAML

name: Claude Code
env:
PNPM_HOME: ~/.pnpm
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
contains(fromJson('["AgentEnder", "barbados-clemens", "Cammisuli", "Coly010", "FrozenPandaz", "isaacplmann", "JamesHenry", "jaysoo", "leosvelperez", "mandarini", "MaxKless", "meeroslav", "nartc", "philipjfulcher", "vsavkin", "xiongemi"]'), github.actor) &&
((github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))))
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
actions: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 250
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y ca-certificates lsof libvips-dev libglib2.0-dev libgirepository1.0-dev
- name: Install Chrome
uses: browser-actions/setup-chrome@v1
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.8.0
run_install: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Cache cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
.cargo-cache
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Install project dependencies
run: |
pnpm install --frozen-lockfile
pnpm playwright install --with-deps
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
timeout-minutes: 90
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
allowed_tools: "Bash,Edit,Read,Write,Glob,Grep,LS,MultiEdit,NotebookRead,NotebookEdit"