Repository navigation
chore(ci): Claude issue triage and automatic security updates - #155
Merged
Merged
Conversation
…ge label) Port of the cp-slider triage: prepare (read-only, who may start it) -> Claude with Read/Grep/Glob/Write only and no network, writing one verdict file -> apply, which validates the verdict against a strict schema, makes the text read-only and posts one comment plus labels. raid is public, so the default is conservative: automatic only for issues opened by an OWNER/MEMBER/COLLABORATOR with write access; an outsider's issue is triaged when a maintainer adds the `triage` label; bots and issues labelled triaged/dependencies/security are skipped. One run per issue. Federation auth, claude-sonnet-5-5. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ix, daily scan) Three lanes, all behind the repository variable SECURITY_AUTOMERGE (off by default; Claude's lane also needs SECURITY_CLAUDE_FIX): 1. security-update.yml (pull_request_target, never checks out the PR): a Dependabot PR that fixes a published advisory (open alert, or OSV), no semver-major bump of a direct dependency, only the four manifests, all commits Dependabot's, manifest checks against the merge base; waits for the exact commit's CI and squash-merges with --match-head-commit. 2. security-fix.yml (workflow_dispatch): Claude (claude-opus-5-5, 60 turns, go build/vet/test only) adapts the code once per PR; a separate job checks the patch (no .github/, no manifests, size, version bump), pushes, reruns CI and the same assessment, then merges. Otherwise a comment and one `security` issue. 3. security-scan.yml (daily): npm audit / govulncheck, deterministic fixes without breaking changes, docs build and go test must pass, one PR per run. Federation auth for Claude, patches treated as data, per-job permissions. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n .github/ changes Bash and node tests with a fake gh (backed by a throwaway git repository), curl, npm, go and govulncheck. A small separate workflow runs them (plus bash -n, node --check and a YAML parse) only for changes under .github/, so the main build matrix is untouched. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…redentials) What each workflow does, the variables and secrets, the OIDC claims the Anthropic federation rule must accept, labels, how to run and stop things by hand, the public-repository policy for triage, and how to verify on main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #155 +/- ##
=======================================
Coverage 93.02% 93.02%
=======================================
Files 48 48
Lines 4487 4487
=======================================
Hits 4174 4174
Misses 201 201
Partials 112 112 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this adds
Two groups of maintainer automation. Everything starts off: nothing merges until
SECURITY_AUTOMERGE=trueis set, and triage and the Claude fix lane need the Anthropic federation variables. No existing workflow is changed (claude.yml,build.yml,deploy.ymlandsrc/resources/app.propertiesare untouched). Full description:docs/AUTOMATION.md.Issue triage (
triage.yml)path:linepointers, whether it is already fixed, duplicates, questions for the reporter) and the labelstriaged, a category,priority: …, andneeds-infoorduplicatewhen they apply.triagelabel, or byworkflow_dispatch. Widening this is a one-line change, documented.claude-sonnet-5-5, max 25 turns.Security updates
security-update.yml): a Dependabot PR that fixes a security alert is merged (squash) once the repo's CI is green on its exact head commit. Only manifests and lockfiles may change; no major bump of a direct dependency; at most 5 new indirect packages; registry packages only; every commit must be Dependabot's. It usespull_request_targetand never checks out or runs the PR's code.security-fix.yml): when CI fails on a bump (the new version needs a code change), Claude (claude-opus-5-5, 60 turns) fixes it. Claude cannot push: it produces a patch that a separate job checks (no.github/, allowlisted paths, size limit, version bump rule) and applies. Off unlessSECURITY_CLAUDE_FIX=true.security-scan.yml): daily, finds fixable advisories withnpm audit(site/) andgovulncheck, tries the deterministic fix, builds the docs site and runs the Go tests, and opens one PR. Look-only on manual runs unlessopen_pr=true.version-checkonly runs forsrc/**).What you need to set after merging
ANTHROPIC_FEDERATION_RULE_IDandANTHROPIC_ORGANIZATION_ID(service account / workspace ids only if the rule needs them). Claims the rule must accept (repo id 966580385, owner id 4384235):audhttps://api.anthropic.com,repository_owner8bitAlex,repository8bitAlex/raidsubrepo:8bitAlex/raid:ref:refs/heads/main(today;repo:8bitAlex@4384235/raid@966580385:ref:refs/heads/mainif immutable subjects are enabled later)job_workflow_ref…/triage.yml@refs/heads/mainand…/security-fix.yml@refs/heads/maingh label create triage(the other new labels are created on first use).gh variable set SECURITY_AUTOMERGE --body trueto turn the merging on;SECURITY_CLAUDE_FIX=truefor Lane 2.SECURITY_ALERTS_TOKEN(fine-grained, Dependabot alerts: read, lets Lane 1 confirm an open alert) andSECURITY_BOT_TOKEN(lets pushes and PRs start workflows, in case the CodeQL ruleset rule waits on scanning results).Testing
gh, throwaway git repos): triage 364, claude-auth 21, security-policy 228, security 295 checks;bash -n,node --checkand a YAML parse of every workflow are clean. A small new workflow,automation-tests.yml, runs them when.github/changes; it passed on this branch.mainand the federation rule. After merging, trygh workflow run triage.yml -f issue=<n>on an existing issue, thengh workflow run security-scan.yml(look-only), and watch the next Dependabot security PR through Lane 1 withSECURITY_AUTOMERGE=true. Things to confirm on the first runs: the Dependabot-startedpull_request_targetrun gets a write token, a workflow-created PR can merge past the CodeQL rule, and the required check names (build (ubuntu|macos|windows-latest),docs).go build/go test(no Go changes) and the docs site build (nosite/changes).Risks
Cost (triage is capped at 25 turns; Lane 2 is Opus, once per PR, off by default); prompt injection (no write path for Claude, strict validator); supply chain (a merge needs a published advisory fix, no major or new direct dependency, and green CI on the exact commit; a compromised release that is itself the fix and passes CI is the residual risk of any auto-merge).
🤖 Generated with Claude Code