Skip to content

refactor(ci): migrate security fix agent to claude-code-action#2085

Merged
peppescg merged 2 commits intomainfrom
refactor/security-agent-claude-code-action
Apr 23, 2026
Merged

refactor(ci): migrate security fix agent to claude-code-action#2085
peppescg merged 2 commits intomainfrom
refactor/security-agent-claude-code-action

Conversation

@peppescg
Copy link
Copy Markdown
Collaborator

Summary

  • Replace direct claude CLI invocation (npm install -g @anthropic-ai/claude-code + claude -p) with anthropics/claude-code-action GitHub Action in the security fix agent workflow
  • Matches the pattern already used by the bug fix agent workflow
  • Add proper job-level permissions and timeout-minutes
  • Add continue-on-error and conditional gating between phases

Changes

  • Removed: Install Claude Code step (no more global npm install)
  • Converted: Phase 1 (Opus) and Phase 2 (Sonnet) to use anthropics/claude-code-action@v1
  • Added: permissions block (contents: write, pull-requests: write, issues: write, id-token: write)
  • Added: timeout-minutes: 45
  • Added: continue-on-error: true on both phases with conditional gating (Phase 2 only runs if Phase 1 succeeds)
  • Added: Bash(pnpm run test:nonInteractive *), Bash(pnpm run lint), Bash(pnpm run type-check) to Phase 2 allowed tools

Test plan

  • Verify workflow YAML is valid (no syntax errors)
  • Trigger a manual workflow_dispatch of the security fix cron to confirm the agent runs correctly
  • Confirm the action picks up ANTHROPIC_API_KEY and runs both phases

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings April 23, 2026 11:02
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 -p execution with anthropics/claude-code-action@v1 for Phase 1 (Opus) and Phase 2 (Sonnet).
  • Adds job-level timeout-minutes and explicit permissions for repo/PR/issue operations.
  • Adds continue-on-error and gates Phase 2 (and downstream “Check for changes”) on Phase 1/2 success.

Comment thread .github/workflows/_security-fix-agent.yml Outdated
Comment thread .github/workflows/_security-fix-agent.yml Outdated
Comment thread .github/workflows/_security-fix-agent.yml Outdated
@peppescg peppescg self-assigned this Apr 23, 2026
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>
Copy link
Copy Markdown
Collaborator

@samuv samuv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@peppescg peppescg merged commit 7faad2c into main Apr 23, 2026
17 checks passed
@peppescg peppescg deleted the refactor/security-agent-claude-code-action branch April 23, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants