Skip to content

fix: skip review on workflow-self-modification PRs (v2.0.1) - #57

Merged
twistedmelonman merged 1 commit into
mainfrom
claude/v2-0-1-workflow-self-mod-skip-20260418
Apr 18, 2026
Merged

fix: skip review on workflow-self-modification PRs (v2.0.1)#57
twistedmelonman merged 1 commit into
mainfrom
claude/v2-0-1-workflow-self-mod-skip-20260418

Conversation

@twistedmelonman

Copy link
Copy Markdown
Member

Summary

Adds a PRIORITY SKIP case to the Check for doc-only diff step: if the PR modifies any .github/workflows/*.yml file, short-circuit with VERDICT: SKIPPED (workflow-self-modification).

Why

The anthropics/claude-code-action@v1 refuses to run on PRs that modify any workflow file in the caller repo (security feature — prevents a PR from modifying the reviewer to hide issues). The action currently exits non-zero after a 30s retry loop, which our Check review verdict step interprets as "exceeded turn limit" and fails the job.

Observed in the v1 → v2 rollout:

Blocks the Dependabot-driven update pattern the user wants to adopt next: Dependabot PRs would need a bypass marker on every auto-generated PR. Not sustainable.

What changes

New logic in claude-blocking-review.yml line ~157, before the existing doc-only check:

while IFS= read -r f; do
  [ -z "$f" ] && continue
  case "$f" in
    .github/workflows/*.yml|.github/workflows/*.yaml)
      echo "::notice::PR modifies .github/workflows/ ($f) — claude-code-action refuses to run by design..."
      echo "skip=true" >> "$GITHUB_OUTPUT"
      echo "## Claude Code Review" >> "$GITHUB_STEP_SUMMARY"
      echo "**Verdict:** SKIPPED (workflow-self-modification)" >> "$GITHUB_STEP_SUMMARY"
      exit 0
      ;;
  esac
done <<< "$FILES"

Uses the same file-list enumeration the doc-only check already does (UNION of previous_filename and filename).

Not a security regression

  • The claude-code-action already cannot review such PRs. We're accommodating its security feature, not defeating it.
  • Humans remain responsible for reviewing workflow changes manually.
  • A malicious workflow change would skip the review under both v2.0.0 and v2.0.1 — the failure mode is unchanged, only the verdict cleanliness differs.

Migration

  • Floating-tag pinners (@v2): picked up automatically once v2 tag advances.
  • Specific-tag pinners (@v2.0.0): bump to @v2.0.1 to get the fix.

This PR enables the planned rollout of Dependabot + @v2.0.1 specific pins across the 27 consumer repos.

Test plan

  • Local pre-commit + pre-push reviewers PASS
  • Match logic manually verified against simulated file lists
  • Dogfood: this PR itself touches .github/workflows/claude-blocking-review.yml — the self-review caller (self-review.yml) is unchanged, so the workflow-validation-skip should NOT fire and this PR should get a normal review (confirming the narrow-fix scope)

🤖 Generated with Claude Code

…2.0.1)

The anthropics/claude-code-action refuses to run on PRs that modify any
workflow file in the caller repo — this is its by-design security
feature (a PR can't modify the reviewer to hide its own issues). The
action currently exits with a non-zero status after a ~30s workflow-
validation retry loop, which our Check review verdict step interprets
as 'exceeded turn limit' and exits 1. Consumer repos hit this on every
caller-workflow edit: Dependabot auto-bumps of the @v2 pin, manual
version bumps, added new workflows, etc.

Observed on PR #1176 (kebab-tax), #70 (dotfiles), #40 (mac-dev-server-
setup) during the v1→v2 rollout. Each required a manual bypass marker
to merge. Dependabot-driven rollouts would need the bypass on EVERY
auto-generated PR, which defeats the point of Dependabot.

Detect the condition in the existing Check for doc-only diff step
(already enumerates the PR's file list). If ANY .github/workflows/*.yml
file is in the UNION of previous_filename and filename, short-circuit
with VERDICT: SKIPPED (workflow-self-modification). The real v2 review
then runs on the next non-workflow PR.

This is a correctness fix, not a security regression:
- The claude-code-action already cannot review such PRs (that's the
  security feature we're accommodating, not defeating).
- Humans remain responsible for reviewing workflow changes manually.
  That was already true under v2.0.0.
- A malicious workflow change would skip the review in both v2.0.0 and
  v2.0.1 — the failure mode is unchanged, only the verdict cleanliness
  differs.

Workflow-self-modification detection runs BEFORE the doc-only check so
that a mixed PR (doc + workflow) hits the more-specific workflow skip
rather than falling through to non-doc review and then failing.

Ship as v2.0.1 (PATCH — narrow bug fix). Consumer migration: none for
@v2 floating-tag pinners; explicit-semver pinners who want the fix
should bump to @v2.0.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@twistedmelonman
twistedmelonman merged commit a2566ef into main Apr 18, 2026
3 checks passed
@twistedmelonman
twistedmelonman deleted the claude/v2-0-1-workflow-self-mod-skip-20260418 branch April 18, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant