Skip to content

Commit 54052ee

Browse files
kirich1409claude
andcommitted
refactor: simplify Claude workflow, remove redundant logic
- Remove custom determine-ref step (action handles checkout internally) - Remove @claude mention checks from if (action filters mentions itself) - Keep author_association gate as the only custom security check Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 85b8b44 commit 54052ee

File tree

1 file changed

+10
-44
lines changed

1 file changed

+10
-44
lines changed

.github/workflows/claude.yml

Lines changed: 10 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,58 +12,26 @@ on:
1212

1313
jobs:
1414
claude:
15-
# Only allow trusted collaborators to trigger Claude via @claude mention
15+
# Only allow trusted collaborators to trigger Claude
1616
if: |
17-
(
18-
github.event.comment.author_association == 'OWNER' ||
19-
github.event.comment.author_association == 'MEMBER' ||
20-
github.event.comment.author_association == 'COLLABORATOR' ||
21-
github.event.review.author_association == 'OWNER' ||
22-
github.event.review.author_association == 'MEMBER' ||
23-
github.event.review.author_association == 'COLLABORATOR' ||
24-
github.event.issue.author_association == 'OWNER' ||
25-
github.event.issue.author_association == 'MEMBER' ||
26-
github.event.issue.author_association == 'COLLABORATOR'
27-
) && (
28-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
29-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
30-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
31-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
32-
)
17+
github.event.comment.author_association == 'OWNER' ||
18+
github.event.comment.author_association == 'MEMBER' ||
19+
github.event.comment.author_association == 'COLLABORATOR' ||
20+
github.event.review.author_association == 'OWNER' ||
21+
github.event.review.author_association == 'MEMBER' ||
22+
github.event.review.author_association == 'COLLABORATOR' ||
23+
github.event.issue.author_association == 'OWNER' ||
24+
github.event.issue.author_association == 'MEMBER' ||
25+
github.event.issue.author_association == 'COLLABORATOR'
3326
runs-on: ubuntu-latest
3427
permissions:
3528
contents: write
3629
pull-requests: write
3730
issues: write
3831
actions: read
3932
steps:
40-
- name: Determine checkout ref
41-
id: determine-ref
42-
uses: actions/github-script@v7
43-
with:
44-
github-token: ${{ secrets.GITHUB_TOKEN }}
45-
script: |
46-
const eventName = context.eventName;
47-
let ref = context.sha;
48-
49-
if (eventName === 'pull_request_review' || eventName === 'pull_request_review_comment') {
50-
ref = context.payload.pull_request.head.sha;
51-
} else if (eventName === 'issue_comment' && context.payload.issue && context.payload.issue.pull_request) {
52-
const prNumber = context.payload.issue.number;
53-
const { data: pr } = await github.rest.pulls.get({
54-
owner: context.repo.owner,
55-
repo: context.repo.repo,
56-
pull_number: prNumber,
57-
});
58-
ref = pr.head.sha;
59-
}
60-
61-
core.setOutput('ref', ref);
62-
6333
- name: Checkout repository
6434
uses: actions/checkout@v6
65-
with:
66-
ref: ${{ steps.determine-ref.outputs.ref }}
6735

6836
- name: Set up JDK 21
6937
uses: actions/setup-java@v5
@@ -83,8 +51,6 @@ jobs:
8351
uses: anthropics/claude-code-action@v1
8452
with:
8553
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
86-
87-
# Configure Claude's behavior for Android/Gradle project
8854
claude_args: |
8955
--model claude-opus-4-6
9056
--max-turns 20

0 commit comments

Comments
 (0)