chore: claude gh action for better output (#1779)

This commit is contained in:
Tom Alexander 2026-03-02 12:55:33 -05:00 committed by GitHub
parent a6c88b5818
commit 174d87798c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 38 additions and 18 deletions

View file

@ -19,32 +19,36 @@ jobs:
(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
contents: write
pull-requests: write
issues: write
id-token: write
actions: read # Required for Claude to read CI results on PRs
actions: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
cache-dependency-path: 'yarn.lock'
- name: Install dependencies
run: yarn install
- name: Build dependencies
run: make ci-build
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
# prompt: 'Update the pull request description to include a summary of changes.'
# Optional: Add claude_args to customize behavior and configuration
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
# or https://docs.claude.com/en/docs/claude-code/sdk#command-line for available options
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
github_token: ${{ secrets.GITHUB_TOKEN }}
use_sticky_comment: 'true'
include_fix_links: 'true'
claude_args: '--max-turns 20'

View file

@ -108,6 +108,22 @@ yarn ci:unit --testNamePattern="test name pattern" # Run tests matching pa
- **Database patterns**: MongoDB for metadata with Mongoose, ClickHouse for
telemetry queries
## GitHub Action Workflow (when invoked via @claude)
When working on issues or PRs through the GitHub Action:
1. **Before writing any code**, post a comment outlining your implementation
plan — which files you'll change, what approach you'll take, and any
trade-offs or risks. Use `gh issue comment` for issues or `gh pr comment`
for PRs.
2. **After making any code changes**, always run these in order and fix any
failures before opening a PR:
- `make ci-lint` — lint + TypeScript type check
- `make ci-unit` — unit tests
3. Write a clear PR description explaining what changed and why.
---
_Need more details? Check the `agent_docs/` directory or ask which documentation