-
Notifications
You must be signed in to change notification settings - Fork 23
Claude review #238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Claude review #238
Changes from all commits
3ac2db8
2a9b973
31185b4
05379fd
59faf01
6a14c1e
7af914f
bf3f4b2
947754d
2282e1e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| name: Claude Code | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this workflow is started with Useful? React with 👍 / 👎. |
||
| issue_comment: | ||
| types: [created] | ||
| pull_request_review_comment: | ||
| types: [created] | ||
| pull_request_review: | ||
| types: [submitted] | ||
|
Comment on lines
+3
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The workflow condition handles Useful? React with 👍 / 👎. |
||
|
|
||
| jobs: | ||
| check-membership: | ||
| if: | | ||
| (github.event_name == 'workflow_dispatch') || | ||
| (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')) | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| outputs: | ||
| is-member: ${{ steps.check.outputs.is-member }} | ||
| steps: | ||
| - name: Validate GitHub App private key | ||
| env: | ||
| CLAUDE_APP_PRIVATE_KEY: ${{ secrets.CLAUDE_APP_PRIVATE_KEY }} | ||
| run: | | ||
| if [ -z "$CLAUDE_APP_PRIVATE_KEY" ]; then | ||
| echo "::error::Repository secret CLAUDE_APP_PRIVATE_KEY is empty or missing." | ||
| exit 1 | ||
| fi | ||
|
|
||
| - name: Create GitHub App token | ||
| id: app-token | ||
| uses: actions/create-github-app-token@v3 | ||
| with: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @claude review |
||
| app-id: 4019885 | ||
| private-key: ${{ secrets.CLAUDE_APP_PRIVATE_KEY }} | ||
| owner: ${{ github.repository_owner }} | ||
|
|
||
| - name: Check if user is organization member | ||
| id: check | ||
| uses: actions/github-script@v9 | ||
| with: | ||
| github-token: ${{ steps.app-token.outputs.token }} | ||
| script: | | ||
| try { | ||
| await github.rest.orgs.checkMembershipForUser({ | ||
| org: context.repo.owner, | ||
| username: context.actor | ||
| }); | ||
|
Comment on lines
+49
to
+52
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This membership gate calls Useful? React with 👍 / 👎. |
||
| core.setOutput('is-member', 'true'); | ||
| } catch (error) { | ||
| core.setOutput('is-member', 'false'); | ||
| core.setFailed(`User ${context.actor} is not a member of ${context.repo.owner}`); | ||
| } | ||
|
|
||
| claude: | ||
| needs: check-membership | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @claude review |
||
| if: needs.check-membership.outputs.is-member == 'true' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read # Read-only access to code | ||
|
CassNot marked this conversation as resolved.
|
||
| pull-requests: write # Can post comments/reviews on PRs | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this workflow is triggered from an Useful? React with 👍 / 👎. |
||
| id-token: write # Required for authentication | ||
| actions: read # Required for Claude to read CI results on PRs | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Granting Useful? React with 👍 / 👎. |
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| fetch-depth: 1 | ||
|
|
||
| - name: Run Claude Code | ||
| id: claude | ||
| uses: anthropics/claude-code-action@v1 | ||
| with: | ||
| anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} | ||
|
Comment on lines
+76
to
+78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The workflow now allows any org member through this custom membership gate, but Useful? React with 👍 / 👎. |
||
|
|
||
| # 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: Configure Claude's behavior with CLI arguments | ||
| # claude_args: | | ||
| # --model claude-opus-4-1-20250805 | ||
| # --max-turns 10 | ||
| # --allowedTools "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)" | ||
| # --system-prompt "Follow our coding standards. Ensure all new code has tests. Use TypeScript for new files." | ||
|
|
||
| # Optional: Advanced settings configuration | ||
| # settings: | | ||
| # { | ||
| # "env": { | ||
| # "NODE_ENV": "test" | ||
| # } | ||
| # } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@claude review