refactor(ci): migrate security fix agent to claude-code-action#2085
Merged
refactor(ci): migrate security fix agent to claude-code-action#2085
Conversation
Replace direct claude CLI invocation with anthropics/claude-code-action GitHub Action, matching the pattern used by the bug fix agent workflow. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Migrates the “security fix agent” workflow from a direct claude CLI invocation to the pinned anthropics/claude-code-action@v1 pattern already used elsewhere in CI, and adds job safeguards/controls for reliability and permissions.
Changes:
- Replaces global
npm install -g @anthropic-ai/claude-code+claude -pexecution withanthropics/claude-code-action@v1for Phase 1 (Opus) and Phase 2 (Sonnet). - Adds job-level
timeout-minutesand explicitpermissionsfor repo/PR/issue operations. - Adds
continue-on-errorand gates Phase 2 (and downstream “Check for changes”) on Phase 1/2 success.
Phase 1 needs Write (not Edit) to create remediation-plan.md. Phase 2 needs Write to create pr-body.md and remediation-title.txt. Without --dangerously-skip-permissions, claude-code-action enforces tool permissions — missing Write would block file creation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
claudeCLI invocation (npm install -g @anthropic-ai/claude-code+claude -p) withanthropics/claude-code-actionGitHub Action in the security fix agent workflowpermissionsandtimeout-minutescontinue-on-errorand conditional gating between phasesChanges
Install Claude Codestep (no more global npm install)anthropics/claude-code-action@v1permissionsblock (contents: write,pull-requests: write,issues: write,id-token: write)timeout-minutes: 45continue-on-error: trueon both phases with conditional gating (Phase 2 only runs if Phase 1 succeeds)Bash(pnpm run test:nonInteractive *),Bash(pnpm run lint),Bash(pnpm run type-check)to Phase 2 allowed toolsTest plan
workflow_dispatchof the security fix cron to confirm the agent runs correctlyANTHROPIC_API_KEYand runs both phases🤖 Generated with Claude Code