From b8b8e3675ab08385298f00fe033941a3d20a02f5 Mon Sep 17 00:00:00 2001 From: Claude Code Bot Date: Mon, 18 May 2026 19:11:16 -0700 Subject: [PATCH] fix(ci): remove issues trigger cascade + add dependabot fast-pass - Remove `issues` event trigger from claude.yml and its corresponding `if:` condition. Issues opened by Ralph/Dependabot were causing cascading Claude invocations that burned Anthropic spend with no useful output. - Add a Dependabot fast-pass to claude-blocking-review.yml that skips AI review when `github.actor == dependabot[bot]`. Version bumps are low-risk, and claude-code-action already refuses to run on PRs that modify workflow files. This eliminates wasted review minutes on every Dependabot PR across all consumer repos. - Update claude-assistant.yml caller documentation to match. --- .github/workflows/claude-assistant.yml | 3 +-- .github/workflows/claude-blocking-review.yml | 27 +++++++++++++++++--- .github/workflows/claude.yml | 5 +--- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/.github/workflows/claude-assistant.yml b/.github/workflows/claude-assistant.yml index d91160b..c7729b8 100644 --- a/.github/workflows/claude-assistant.yml +++ b/.github/workflows/claude-assistant.yml @@ -11,8 +11,7 @@ name: Claude Code Assistant # if: | # (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) || # (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) || -# (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) || -# (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) +# (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) # permissions: # contents: read # issues: read diff --git a/.github/workflows/claude-blocking-review.yml b/.github/workflows/claude-blocking-review.yml index 43b26a9..ebfb3ac 100644 --- a/.github/workflows/claude-blocking-review.yml +++ b/.github/workflows/claude-blocking-review.yml @@ -221,9 +221,22 @@ jobs: echo "skip=false" >> "$GITHUB_OUTPUT" fi + - name: Check for Dependabot PR + id: dependabot-check + if: steps.doc-check.outputs.skip != 'true' + run: | + if [ "${{ github.actor }}" = "dependabot[bot]" ]; then + echo "::notice::Dependabot PR — skipping AI review (version bumps are low-risk)." + echo "skip=true" >> "$GITHUB_OUTPUT" + echo "## Claude Code Review" >> "$GITHUB_STEP_SUMMARY" + echo "**Verdict:** SKIPPED (Dependabot version bump)" >> "$GITHUB_STEP_SUMMARY" + else + echo "skip=false" >> "$GITHUB_OUTPUT" + fi + - name: Estimate review parameters id: estimate - if: steps.doc-check.outputs.skip != 'true' + if: steps.doc-check.outputs.skip != 'true' && steps.dependabot-check.outputs.skip != 'true' env: GH_TOKEN: ${{ github.token }} PR_NUMBER: ${{ inputs.pr_number }} @@ -281,7 +294,7 @@ jobs: echo "| Timeout | ${TIMEOUT}m |" >> "$GITHUB_STEP_SUMMARY" - name: Minimize prior review comments - if: steps.doc-check.outputs.skip != 'true' + if: steps.doc-check.outputs.skip != 'true' && steps.dependabot-check.outputs.skip != 'true' env: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} @@ -336,7 +349,7 @@ jobs: - name: Run Claude Code Review id: claude-review - if: steps.doc-check.outputs.skip != 'true' + if: steps.doc-check.outputs.skip != 'true' && steps.dependabot-check.outputs.skip != 'true' timeout-minutes: ${{ fromJSON(steps.estimate.outputs.timeout_minutes) }} continue-on-error: true # infrastructure failure must not block merges uses: anthropics/claude-code-action@26ec041249acb0a944c0a47b6c0c13f05dbc5b44 # v1 @@ -475,6 +488,7 @@ jobs: PR_NUMBER: ${{ inputs.pr_number }} CLAUDE_OUTCOME: ${{ steps.claude-review.outcome }} DOC_SKIP: ${{ steps.doc-check.outputs.skip }} + DEPENDABOT_SKIP: ${{ steps.dependabot-check.outputs.skip }} run: | # Short-circuit: doc-only diff already wrote its summary in the # Check for doc-only diff step. Nothing to verify, nothing to block. @@ -483,6 +497,11 @@ jobs: exit 0 fi + if [ "$DEPENDABOT_SKIP" = "true" ]; then + echo "Dependabot skip — no verdict required." + exit 0 + fi + # Escape hatch: [skip-claude-review] or [skip-claude-review: reason] in PR body # bypasses enforcement. The extended regex matches both the bare token and the # documented `: reason` form advertised by our error messages. See issue #38 @@ -554,7 +573,7 @@ jobs: fi - name: Minimize PASS review comment - if: always() && steps.doc-check.outputs.skip != 'true' + if: always() && steps.doc-check.outputs.skip != 'true' && steps.dependabot-check.outputs.skip != 'true' env: GH_TOKEN: ${{ github.token }} REPO: ${{ github.repository }} diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index beb034e..78bf881 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -5,8 +5,6 @@ on: types: [created] pull_request_review_comment: types: [created] - issues: - types: [opened, assigned] pull_request_review: types: [submitted] @@ -15,8 +13,7 @@ jobs: if: | (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) || (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.comment.author_association)) || - (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) || - (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')) && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.issue.author_association)) + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude') && contains(fromJSON('["OWNER", "MEMBER", "COLLABORATOR"]'), github.event.review.author_association)) permissions: contents: read issues: read