Repository navigation
Commit b6eb059
authored
fix(ci): let AI code review run on external contributor PRs (#6185)
The reviewer aborted on every fork PR with "Actor does not have write
permissions to the repository" (e.g. run 31217496013 on #6166), so it
only ever ran for collaborators.
claude-code-action checks that the PR author has write access before
doing anything. That default protects its normal @claude usage, where a
read-only user's comment becomes the prompt. It does not apply here:
pull_request_target always runs the base-branch copy of this workflow,
so the prompt is fixed by maintainers and a fork cannot supply it.
Set allowed_non_write_users so the review actually runs, and harden the
prompt-injection surface it exposes (untrusted diff/PR text entering
context):
- deny Read on /proc, /sys, ~/.aws, the Actions _temp dir and .git/config
so an injected instruction cannot use the review comment as a
secret-exfiltration channel
- instruct the model to treat all contributor-authored content as data,
never as instructions, and to report attempted injection
Fork PRs continue to require maintainer approval via the manual-approval
environment, Bash/Write/Edit remain unavailable, and the assumed role is
still limited to bedrock:InvokeModel on a single inference profile.1 parent 1db06c5 commit b6eb059
1 file changed
Lines changed: 32 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
114 | 135 | | |
115 | 136 | | |
116 | 137 | | |
117 | 138 | | |
118 | 139 | | |
119 | 140 | | |
120 | 141 | | |
| 142 | + | |
121 | 143 | | |
122 | 144 | | |
123 | 145 | | |
| |||
128 | 150 | | |
129 | 151 | | |
130 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
131 | 163 | | |
132 | 164 | | |
133 | 165 | | |
| |||
0 commit comments