add matvey! #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Claude Code | ||
|
Check failure on line 1 in .github/workflows/claude-code.yml
|
||
| on: | ||
| workflow_call: | ||
| secrets: | ||
| CLAUDE_CODE_OAUTH_TOKEN: | ||
| required: true | ||
| jobs: | ||
| claude-code: | ||
| if: | | ||
| (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 | ||
| id-token: write | ||
| actions: read # Required for Claude to read CI results on PRs | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| fetch-depth: 10 # give Claude a bit more context | ||
| persist-credentials: false | ||
| - name: Setup environment | ||
| uses: ./.github/actions/setup-env | ||
| - name: Run Claude Code | ||
| id: claude | ||
| uses: anthropics/claude-code-action@e26577a930883943cf9d90885cd1e8da510078dd # beta tag | ||
| with: | ||
| # Dynamically set the secret based on the user who triggered the workflow | ||
| # use their oauth token, since otherwise Anthropic will ban accounts for abuse :( | ||
| claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }} | ||
| # This is an optional setting that allows Claude to read CI results on PRs | ||
| # See https://github.com/anthropics/claude-code-action?tab=readme-ov-file#additional-permissions-for-cicd-integration | ||
| additional_permissions: | | ||
| actions: read | ||
| # Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4) | ||
| model: "claude-opus-4-20250514" | ||
| fallback_model: "claude-sonnet-4-20250514" | ||
| # Optional: Customize the trigger phrase (default: @claude) | ||
| # trigger_phrase: "/claude" | ||
| # Optional: Trigger when specific user is assigned to an issue | ||
| assignee_trigger: "claude-bot" | ||
| # Optional: Allow Claude to run specific commands | ||
| allowed_tools: | | ||
| Bash(pnpm install) | ||
| Bash(pnpm add:*) | ||
| Bash(pnpm test) | ||
| Bash(pnpm typecheck) | ||
| Bash(pnpm codegen:*) | ||
| Bash(pnpm prettier:*) | ||
| # Optional: Add custom instructions for Claude to customize its behavior for your project | ||
| # Additional context added to Claude's system prompt while still respecting normal triggers. | ||
| # These instructions modify Claude's behavior but don't replace the triggering comment. | ||
| custom_instructions: | | ||
| Analyze the following GitHub Pull Request and respond to the comment from $TRIGGER_USERNAME: "$TRIGGER_COMMENT" | ||
| Repository: $REPOSITORY | ||
| PR #: $PR_NUMBER | ||
| Changed files: | ||
| $CHANGED_FILES | ||
| Title: | ||
| $PR_TITLE | ||
| Description: | ||
| $PR_BODY | ||
| All PR comments: | ||
| $PR_COMMENTS | ||
| # Optional: Custom environment variables for Claude | ||
| # claude_env: | | ||
| # NODE_ENV: test | ||