Repository navigation
chore: enable Claude issue trigger per org CI standard #30
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
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 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,7 +1,5 @@ | ||||||||||||||||||||||
| name: Claude Code | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| permissions: {} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| on: | ||||||||||||||||||||||
| pull_request: | ||||||||||||||||||||||
| branches: [main] | ||||||||||||||||||||||
|
|
@@ -10,6 +8,10 @@ on: | |||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||
| pull_request_review_comment: | ||||||||||||||||||||||
| types: [created] | ||||||||||||||||||||||
| issues: | ||||||||||||||||||||||
| types: [labeled] | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| permissions: {} | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||
| claude: | ||||||||||||||||||||||
|
|
@@ -21,16 +23,21 @@ jobs: | |||||||||||||||||||||
| contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || | ||||||||||||||||||||||
| (github.event_name == 'pull_request_review_comment' && | ||||||||||||||||||||||
| contains(github.event.comment.body, '@claude') && | ||||||||||||||||||||||
| contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) | ||||||||||||||||||||||
| contains(fromJson('["OWNER","MEMBER","COLLABORATOR"]'), github.event.comment.author_association)) || | ||||||||||||||||||||||
| (github.event_name == 'issues' && github.event.action == 'labeled' && | ||||||||||||||||||||||
| github.event.label.name == 'claude') | ||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||
| timeout-minutes: 60 | ||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||
| # write required for issue-triggered branch creation | ||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||
| id-token: write | ||||||||||||||||||||||
| pull-requests: write | ||||||||||||||||||||||
| issues: write | ||||||||||||||||||||||
| steps: | ||||||||||||||||||||||
| - name: Run Claude Code | ||||||||||||||||||||||
| uses: anthropics/claude-code-action@e7b588b6eaa5263c2e7c6c7b34a29e190d32ee68 # v1 | ||||||||||||||||||||||
| if: github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]' | ||||||||||||||||||||||
|
||||||||||||||||||||||
| if: github.event_name != 'pull_request' || github.event.pull_request.user.login != 'dependabot[bot]' | |
| if: >- | |
| (github.event_name == 'pull_request' && | |
| github.event.pull_request.user.login != 'dependabot[bot]') || | |
| (github.event_name == 'issue_comment' && | |
| github.event.issue.user.login != 'dependabot[bot]') || | |
| (github.event_name == 'pull_request_review_comment' && | |
| github.event.pull_request.user.login != 'dependabot[bot]') || | |
| (github.event_name == 'issues' && | |
| github.event.issue.user.login != 'dependabot[bot]') |
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.
contents: writeis now granted for the entire job across all triggers (including automatic runs onpull_requestsynchronize/open). If write access is only needed for the issue-label workflow (branch creation), consider splitting into separate jobs/workflows so PR/comment handling can keepcontents: read(least-privilege) and only the issue-triggered path gets write permissions.