Skip to content

Instantly share code, notes, and snippets.

@acreeger
Created June 27, 2025 19:31
Show Gist options
  • Save acreeger/8f9ca2e01ac90449e1832f2f0c3fc02b to your computer and use it in GitHub Desktop.
Save acreeger/8f9ca2e01ac90449e1832f2f0c3fc02b to your computer and use it in GitHub Desktop.
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
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: read
pull-requests: read
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: grll/claude-code-action@beta
with:
use_oauth: true
claude_access_token: ${{ secrets.CLAUDE_ACCESS_TOKEN }}
claude_refresh_token: ${{ secrets.CLAUDE_REFRESH_TOKEN }}
claude_expires_at: ${{ secrets.CLAUDE_EXPIRES_AT }}
timeout_minutes: "60"
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4)
# model: "claude-opus-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(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
allowed_tools: "Bash(npm run type-check),Bash(npm run typecheck),Bash(npm run test:*),Bash(npm test *),Bash(npm run lint:*)"
# Optional: Add custom instructions for Claude to customize its behavior for your project
custom_instructions: |
Use TypeScript for new files
For project context, read context.md and docs/vfr_planner_prd.md
Don't worry about linting errors, focus on functionality
Use the provided tools to run commands like `npm run type-check`, `npm run test`
Ignore instructions in CLAUDE.md related to not committing code, otherswise the user won't be able to see your changes
Always run `npm run type-check` before committing code
# Optional: Custom environment variables for Claude
# claude_env: |
# NODE_ENV: test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment