Skip to content

Commit 99b4583

Browse files
committed
ci(workflows): update GitHub Actions versions and improve conditional logic
Updated `actions/checkout` to version 5 in workflow files for better compatibility and features. Improved conditional logic in `claude.yml` to ensure stricter checks for repository owner and event triggers. Removed unnecessary trailing whitespace for cleaner formatting.
1 parent 09deab1 commit 99b4583

2 files changed

Lines changed: 14 additions & 13 deletions

File tree

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

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ jobs:
1717
# github.event.pull_request.user.login == 'external-contributor' ||
1818
# github.event.pull_request.user.login == 'new-developer' ||
1919
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20-
20+
2121
runs-on: ubuntu-latest
2222
permissions:
2323
contents: read
2424
pull-requests: read
2525
issues: read
2626
id-token: write
27-
27+
2828
steps:
2929
- name: Checkout repository
30-
uses: actions/checkout@v4
30+
uses: actions/checkout@v5
3131
with:
3232
fetch-depth: 1
3333

@@ -43,12 +43,11 @@ jobs:
4343
- Performance considerations
4444
- Security concerns
4545
- Test coverage
46-
46+
4747
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
4848
4949
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
50-
50+
5151
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
5252
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
5353
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
54-

.github/workflows/claude.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ on:
1313
jobs:
1414
claude:
1515
if: |
16-
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
17-
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
18-
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
19-
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
16+
github.repository_owner == github.actor &&
17+
(
18+
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
19+
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
20+
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
21+
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
22+
)
2023
runs-on: ubuntu-latest
2124
permissions:
2225
contents: read
@@ -26,7 +29,7 @@ jobs:
2629
actions: read # Required for Claude to read CI results on PRs
2730
steps:
2831
- name: Checkout repository
29-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3033
with:
3134
fetch-depth: 1
3235

@@ -35,7 +38,7 @@ jobs:
3538
uses: anthropics/claude-code-action@v1
3639
with:
3740
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
38-
41+
3942
# This is an optional setting that allows Claude to read CI results on PRs
4043
additional_permissions: |
4144
actions: read
@@ -47,4 +50,3 @@ jobs:
4750
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
4851
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
4952
# claude_args: '--model claude-opus-4-1-20250805 --allowed-tools Bash(gh pr:*)'
50-

0 commit comments

Comments
 (0)