Skip to content

Commit 81131d7

Browse files
ovitrifclaude
andcommitted
fix: align Claude workflows with bitkit-ios gold standard
- claude.yml: use fromJSON syntax for author_association checks, add inline comments, remove deprecated use_api_for_commits - claude-code-review.yml: add reference comment links Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 112eb05 commit 81131d7

2 files changed

Lines changed: 23 additions & 12 deletions

File tree

.github/workflows/claude-code-review.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ jobs:
5151
plugin_marketplaces: 'https://github.com/anthropics/claude-code.git'
5252
plugins: 'code-review@claude-code-plugins'
5353
prompt: '/code-review:code-review ${{ github.repository }}/pull/${{ github.event.pull_request.number }}'
54+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
55+
# or https://code.claude.com/docs/en/cli-reference for available options

.github/workflows/claude.yml

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,34 +12,43 @@ on:
1212

1313
jobs:
1414
claude:
15+
# Only allow trusted actors (OWNER, MEMBER, COLLABORATOR) to trigger Claude with write permissions
1516
if: |
1617
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') &&
17-
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
18+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
1819
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') &&
19-
(github.event.comment.author_association == 'OWNER' || github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'COLLABORATOR')) ||
20+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) ||
2021
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') &&
21-
(github.event.review.author_association == 'OWNER' || github.event.review.author_association == 'MEMBER' || github.event.review.author_association == 'COLLABORATOR')) ||
22-
(github.event_name == 'issues' &&
23-
(contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
24-
(github.event.issue.author_association == 'OWNER' || github.event.issue.author_association == 'MEMBER' || github.event.issue.author_association == 'COLLABORATOR'))
22+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) ||
23+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) &&
24+
contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association))
2525
runs-on: ubuntu-latest
2626
permissions:
27-
contents: write
28-
pull-requests: write
29-
issues: write
27+
contents: write # Allow creating branches/commits
28+
pull-requests: write # Allow pushing to PR branches
29+
issues: write # Allow updating issue comments
3030
id-token: write
31-
actions: read
31+
actions: read # Required for Claude to read CI results on PRs
3232
steps:
3333
- name: Checkout repository
3434
uses: actions/checkout@v4
3535
with:
36-
fetch-depth: 0
36+
fetch-depth: 0 # Full history for git operations
3737

3838
- name: Run Claude Code
3939
id: claude
4040
uses: anthropics/claude-code-action@v1
4141
with:
4242
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
43-
use_api_for_commits: true
43+
44+
# This is an optional setting that allows Claude to read CI results on PRs
4445
additional_permissions: |
4546
actions: read
47+
48+
# Optional: Give a custom prompt to Claude. If this is not specified, Claude will perform the instructions specified in the comment that tagged it.
49+
# prompt: 'Update the pull request description to include a summary of changes.'
50+
51+
# Optional: Add claude_args to customize behavior and configuration
52+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
53+
# or https://code.claude.com/docs/en/cli-reference for available options
54+
# claude_args: '--allowed-tools Bash(gh pr:*)'

0 commit comments

Comments
 (0)