|
65 | 65 | # Reusable workflows are constrained by the caller's permissions, |
66 | 66 | # so they must be explicitly declared here. |
67 | 67 | permissions: |
68 | | - checks: read # Reference CI results |
69 | | - contents: read # Read repository contents for review |
70 | | - discussions: read # Reference discussions |
71 | | - id-token: write # Required for Claude Code Action |
72 | | - issues: read # Reference issues |
73 | | - pages: read # Reference existing documentation |
74 | | - pull-requests: write # Post review comments on PRs |
75 | | - repository-projects: read # Reference project schedules |
76 | | - security-events: read # Reference vulnerability reports |
| 68 | + contents: read # Read repository contents for checkout |
| 69 | + id-token: write # Required for Claude Code Action OIDC authentication |
77 | 70 |
|
78 | 71 | jobs: |
79 | 72 | kyosei: |
|
83 | 76 | ``` |
84 | 77 |
|
85 | 78 | Most Composite Action inputs can be passed via `with:`. |
86 | | -The Reusable Workflow additionally accepts `fetch-depth` and `timeout-minutes`, |
87 | | -but does not expose `github_token` (it manages checkout and tokens internally). |
| 79 | +The Reusable Workflow additionally accepts `fetch-depth` and `timeout-minutes`. |
88 | 80 | See the Composite Action section below for the full input list. |
89 | 81 |
|
90 | 82 | ## Composite Action |
|
101 | 93 | types: [opened, synchronize] |
102 | 94 |
|
103 | 95 | permissions: |
104 | | - checks: read # Reference CI results |
105 | | - contents: read # Read repository contents for review |
106 | | - discussions: read # Reference discussions |
107 | | - id-token: write # Required for Claude Code Action |
108 | | - issues: read # Reference issues |
109 | | - pages: read # Reference existing documentation |
110 | | - pull-requests: write # Post review comments on PRs |
111 | | - repository-projects: read # Reference project schedules |
112 | | - security-events: read # Reference vulnerability reports |
| 96 | + contents: read # Read repository contents for checkout |
| 97 | + id-token: write # Required for Claude Code Action OIDC authentication |
113 | 98 |
|
114 | 99 | jobs: |
115 | 100 | review: |
@@ -182,34 +167,17 @@ To add tools without replacing the defaults, use `additional_allowed_tools`: |
182 | 167 |
|
183 | 168 | ## Permissions |
184 | 169 |
|
185 | | -The following permissions are required: |
| 170 | +When `github_token` is omitted (default), Claude GitHub App manages its own token, |
| 171 | +so the workflow only needs minimal permissions: |
186 | 172 |
|
187 | 173 | ```yaml |
188 | 174 | permissions: |
189 | | - checks: read # Reference CI results |
190 | | - contents: read # Read repository contents for review |
191 | | - discussions: read # Reference discussions |
192 | | - id-token: write # Required for Claude Code Action |
193 | | - issues: read # Reference issues |
194 | | - pages: read # Reference existing documentation |
195 | | - pull-requests: write # Post review comments on PRs |
196 | | - repository-projects: read # Reference project schedules |
197 | | - security-events: read # Reference vulnerability reports |
| 175 | + contents: read # Read repository contents for checkout |
| 176 | + id-token: write # Required for Claude Code Action OIDC authentication |
198 | 177 | ``` |
199 | 178 |
|
200 | | -The minimum permissions required to run are: |
201 | | - |
202 | | -```yaml |
203 | | -permissions: |
204 | | - contents: read |
205 | | - id-token: write |
206 | | - pull-requests: write |
207 | | -``` |
208 | | - |
209 | | -The other permissions allow the review agent to reference |
210 | | -additional context (CI results, issues, discussions, etc.) |
211 | | -for better review quality. |
212 | | - |
| 179 | +If you explicitly pass `github_token`, the token needs additional permissions |
| 180 | +such as `pull-requests: write` for posting review comments. |
213 | 181 | If the token lacks `pull-requests: write` |
214 | 182 | (e.g. due to workflow file changes in the PR or fork PRs), |
215 | 183 | the action will skip gracefully with a warning instead of failing. |
|
0 commit comments