You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- claude.yml workflow-file pre-flight: switch from
`gh pr diff --name-only` to `gh pr view --json files`. The diff
form reports only the rename destination, so a rename OUT of
`.github/workflows/**` (e.g. `.github/workflows/ci.yml -> docs/ci.yml`)
would leave `touches_workflows=0` even though Phase B push would
still 403 on the source path. The view form returns both `path`
(added/modified/deleted/destination) and `previousPath` (source
side of renames); we now check either side. Also defensive case
on the count: non-numeric / blank ⇒ fail-CLOSED to 1.
- claude.yml "Resolve PR head ref name": stderr no longer merged
into `head_ref`. The previous `2>&1` (added in R3 to get error
context on failure) also captured non-fatal `gh` warnings on
success, which would write a polluted value like `warning ...
branch-name` to `GITHUB_OUTPUT`. Phase B then used that as the
push target via `git push origin HEAD:$BRANCH` and the run would
fail. New form: capture stderr to a temp file, only emit
`GITHUB_OUTPUT` from stdout on success, surface stderr only in
the warning path.
Verification: GOWORK=off go build/vet ./... — green.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
echo "::warning::PR #$PR_NUMBER touches .github/workflows/** — CI claude task cannot push under GH_ACTIONS_TOKEN scope. Posting a guidance comment and exiting cleanly so cron does not retry indefinitely."
@@ -153,12 +171,19 @@ jobs:
153
171
# of failure for every @claude run. On failure, leave
154
172
# `head_ref` unset; the skill will fall back to its in-skill
155
173
# PR detection.
174
+
# IMPORTANT: capture stderr separately so non-fatal `gh`
175
+
# warnings don't pollute the `head_ref` value (a polluted
176
+
# value would propagate into the skill's `git push origin
177
+
# HEAD:$BRANCH` and turn a healthy run into an invalid push).
156
178
if [[ -n "$PR_NUMBER" ]]; then
157
-
if head_ref=$(gh pr view "$PR_NUMBER" --repo "$GH_REPO" --json headRefName --jq .headRefName 2>&1); then
179
+
err_file=$(mktemp)
180
+
if head_ref=$(gh pr view "$PR_NUMBER" --repo "$GH_REPO" --json headRefName --jq .headRefName 2>"$err_file"); then
158
181
echo "head_ref=$head_ref" >> "$GITHUB_OUTPUT"
159
182
else
160
-
echo "::warning::Resolve PR head ref name: gh pr view failed (PR_NUMBER=$PR_NUMBER): $head_ref — skill will derive from PR_NUMBER directly"
183
+
err_msg=$(cat "$err_file")
184
+
echo "::warning::Resolve PR head ref name: gh pr view failed (PR_NUMBER=$PR_NUMBER): $err_msg — skill will derive from PR_NUMBER directly"
0 commit comments