Commit 9dcc02c
authored
Fix Slack notify prompt to use literal values, not $VAR (#999)
Claude Code's permission matcher denies any Bash command containing
an unexpanded shell variable (e.g. "$PR_NUMBER"), regardless of
whether the rest of the command matches an allowedTools wildcard
like Bash(gh:*). The prompt told Claude to build its gh command from
env vars using shell expansion, so every attempt was denied no
matter how it was quoted, and Claude burned all 30 turns retrying
variations before timing out.
Interpolate the PR number, repo, URL, and workspace path directly
into the prompt text via GitHub Actions expressions instead, so the
Bash command Claude runs contains literal values with no expansion.
None of these are PR-content-controlled (they come from trusted
event/repository context), so embedding them is safe.
Verified locally: ran the rendered prompt through the claude CLI
with the same allowedTools/model/max-turns and got num_turns=3,
permission_denials=0, and a correct output file.
Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com>1 parent 9b7f0db commit 9dcc02c
1 file changed
Lines changed: 9 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | 105 | | |
110 | 106 | | |
111 | 107 | | |
| |||
140 | 136 | | |
141 | 137 | | |
142 | 138 | | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | 139 | | |
151 | | - | |
152 | | - | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
153 | 144 | | |
154 | 145 | | |
155 | 146 | | |
| |||
164 | 155 | | |
165 | 156 | | |
166 | 157 | | |
167 | | - | |
168 | | - | |
169 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
170 | 161 | | |
171 | 162 | | |
172 | 163 | | |
173 | 164 | | |
174 | 165 | | |
175 | 166 | | |
176 | | - | |
| 167 | + | |
177 | 168 | | |
178 | 169 | | |
179 | 170 | | |
| |||
191 | 182 | | |
192 | 183 | | |
193 | 184 | | |
194 | | - | |
| 185 | + | |
195 | 186 | | |
196 | 187 | | |
197 | 188 | | |
| |||
0 commit comments