From 98d935ef6222f747728a34087c311934fdeb6da5 Mon Sep 17 00:00:00 2001 From: srpatcha Date: Tue, 25 Aug 2026 00:16:38 -0700 Subject: [PATCH] chore(ci): remove Dependabot, add Claude code review Dependabot is disabled org-wide: config removed here, and alerts plus automated security fixes turned off via the API. 90 open Dependabot PRs were closed. Note this also stops CVE alerts for dependencies. Adds .github/workflows/claude-code-review.yml. It complements the automatic Copilot review now enforced on the default branch: Copilot does the first pass on every PR, Claude runs on demand via @claude or the deep-review label. Needs an ANTHROPIC_API_KEY secret. Co-Authored-By: Claude Opus 5 --- .github/dependabot.yml | 75 ------------- .github/workflows/claude-code-review.yml | 132 +++++++++++++++++++++++ 2 files changed, 132 insertions(+), 75 deletions(-) delete mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/claude-code-review.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index d618022..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Standard, org-uniform Dependabot configuration template. -# -# Each repo should drop this file at .github/dependabot.yml and uncomment the -# ecosystem entries that apply. Keep weekly cadence so review backlogs stay -# manageable. Auto-assigning all PRs to a single triage owner (@srpatcha) -# prevents the "ten people CC'd, no one acts" failure mode. -# -# Reference template lives at embeddedos-org/.github/.github/dependabot-template.yml. - -version: 2 -updates: - # GitHub Actions — every repo should keep this enabled. - - package-ecosystem: github-actions - directory: / - schedule: - interval: weekly - day: monday - open-pull-requests-limit: 5 - assignees: - - srpatcha - labels: - - dependencies - - github-actions - - # Python — uncomment in repos with pyproject.toml or requirements.txt. - # - package-ecosystem: pip - # directory: / - # schedule: - # interval: weekly - # day: monday - # open-pull-requests-limit: 5 - # assignees: - # - srpatcha - # labels: - # - dependencies - # - python - - # Node.js — uncomment in repos with package.json. - - package-ecosystem: npm - directory: / - schedule: - interval: weekly - day: monday - open-pull-requests-limit: 5 - assignees: - - srpatcha - labels: - - dependencies - - npm - - # Go — uncomment in repos with go.mod. - # - package-ecosystem: gomod - # directory: / - # schedule: - # interval: weekly - # day: monday - # open-pull-requests-limit: 5 - # assignees: - # - srpatcha - # labels: - # - dependencies - # - go - - # Docker — uncomment in repos with Dockerfile. - # - package-ecosystem: docker - # directory: / - # schedule: - # interval: weekly - # day: monday - # open-pull-requests-limit: 3 - # assignees: - # - srpatcha - # labels: - # - dependencies - # - docker diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml new file mode 100644 index 0000000..aa02b2b --- /dev/null +++ b/.github/workflows/claude-code-review.yml @@ -0,0 +1,132 @@ +# Claude code review. +# +# This complements — it does not replace — the automatic Copilot review that +# runs on every PR via the "Code Quality Copilot review for default branch" +# ruleset. Copilot does the fast first pass; Claude does the deeper one, and +# only when asked, so routine PRs cost nothing. +# +# Two ways in: +# 1. Mention @claude in an issue, a PR comment, or a review comment. +# 2. Add the `deep-review` label to a PR for a full review pass. +# +# Requires an ANTHROPIC_API_KEY secret (org-level is easiest — one secret +# covers every repo). Without it both jobs fail fast with a clear message +# rather than reviewing silently with no credentials. +name: Claude Code Review + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + pull_request_review: + types: [submitted] + issues: + types: [opened, assigned, labeled] + pull_request: + types: [labeled] + +# Never run two reviews on the same PR at once; a new trigger supersedes the +# one in flight. +concurrency: + group: claude-review-${{ github.event.pull_request.number || github.event.issue.number || github.ref }} + cancel-in-progress: true + +jobs: + # ── 1. On-demand: someone wrote @claude ────────────────────────────────── + mention: + if: | + github.event_name != 'pull_request' && ( + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + ) + runs-on: ubuntu-latest + timeout-minutes: 20 + permissions: + contents: read + pull-requests: write + issues: write + id-token: write + steps: + - name: Check credentials + env: + KEY: ${{ secrets.ANTHROPIC_API_KEY }} + run: | + if [ -z "$KEY" ]; then + echo "::error::ANTHROPIC_API_KEY is not set. Add it as an organisation or repository secret." + exit 1 + fi + + - uses: actions/checkout@v6 + with: + fetch-depth: 1 + + - uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + use_sticky_comment: true + + # ── 2. Full pass: PR labelled `deep-review` ────────────────────────────── + deep-review: + if: github.event_name == 'pull_request' && github.event.label.name == 'deep-review' + runs-on: ubuntu-latest + timeout-minutes: 30 + permissions: + contents: read + pull-requests: write + id-token: write + steps: + - name: Check credentials + env: + KEY: ${{ secrets.ANTHROPIC_API_KEY }} + run: | + if [ -z "$KEY" ]; then + echo "::error::ANTHROPIC_API_KEY is not set. Add it as an organisation or repository secret." + exit 1 + fi + + - uses: actions/checkout@v6 + with: + fetch-depth: 1 + + - uses: anthropics/claude-code-action@v1 + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} + use_sticky_comment: true + prompt: | + REPO: ${{ github.repository }} + PR NUMBER: ${{ github.event.pull_request.number }} + + Review this pull request. The PR branch is already checked out in + the working directory. + + This repository follows the standards in its own CLAUDE.md, + QUALITY.md, TESTING.md, SECURITY.md and VERIFY.md — read the ones + that apply to the changed files and review against them, not + against generic style preferences. + + Prioritise, in this order: + 1. Correctness — logic errors, unhandled failure paths, integer + overflow/underflow, memory safety, race conditions. + 2. Security — unvalidated input crossing a boundary, injection, + authorization that checks only authentication, secrets in + source or logs. + 3. Tests — does a new behaviour have a test that would actually + fail without the fix? Flag assertions that cannot fail, and + tests that only check the negative case. + 4. Maintainability — only where it genuinely impedes a reader. + + Report what you verified and what you could not. Say plainly when + a concern is unverified rather than implying you checked it. If + nothing needs changing, say so in one line — do not manufacture + findings. + + Use `gh pr comment` for top-level feedback. + Use `mcp__github_inline_comment__create_inline_comment` (with + `confirmed: true`) for specific lines. + Only post GitHub comments — do not return review text as a message. + + claude_args: | + --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr checks:*)"