Sets up GitHub Actions workflow to automatically analyze CI failures, apply fixes for common issues, and open issues for complex problems using Claude Code.
npx claudepluginhub laurigates/claude-plugins --plugin github-actions-pluginThis skill is limited to using the following tools:
Automated CI failure analysis and remediation using Claude Code Action.
Creates isolated Git worktrees for feature branches with prioritized directory selection, gitignore safety checks, auto project setup for Node/Python/Rust/Go, and baseline verification.
Executes implementation plans in current session by dispatching fresh subagents per independent task, with two-stage reviews: spec compliance then code quality.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
Automated CI failure analysis and remediation using Claude Code Action.
| Use this skill when... | Use something else when... |
|---|---|
| Setting up auto-fix workflow for a repo | Fixing a single PR's checks (/git:fix-pr) |
| Customizing which workflows trigger auto-fix | Inspecting workflow runs manually (/workflow:inspect) |
| Understanding the auto-fix pattern | Writing new workflows from scratch (/workflow:dev) |
find .github/workflows -maxdepth 1 -name 'github-workflow-auto-fix.yml'find .github/workflows -maxdepth 1 -name '*.yml' -type fgh secret listParse from $ARGUMENTS:
--setup: Create or update the auto-fix workflow in .github/workflows/--workflows <names>: Comma-separated workflow names to monitor (default: auto-detect CI workflows)--dry-run: Show what would be created without writing filesExecute this workflow setup process:
.github/workflows/github-workflow-auto-fix.yml already existsname: fieldsCLAUDE_CODE_OAUTH_TOKEN secret is configuredIf --workflows provided, use those. Otherwise, auto-detect suitable workflows:
Good candidates for auto-fix monitoring:
Skip these (not suitable for auto-fix):
If --setup or workflow is missing, create .github/workflows/github-workflow-auto-fix.yml:
name: Auto-fix Workflow Failures
on:
workflow_run:
workflows:
# List monitored workflows here
- "CI"
- "Lint"
types: [completed]
concurrency:
group: auto-fix-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
issues: write
actions: read
id-token: write
jobs:
auto-fix:
if: >-
github.event.workflow_run.conclusion == 'failure' &&
github.event.workflow_run.actor.type != 'Bot' &&
github.event.workflow_run.head_branch != 'main' &&
github.event.workflow_run.head_branch != 'master'
runs-on: ubuntu-latest
steps:
- name: Checkout failed branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_branch }}
fetch-depth: 0
- name: Gather failure context
id: context
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
RUN_ID="${{ github.event.workflow_run.id }}"
gh run view "$RUN_ID" --log-failed 2>&1 | tail -500 > .auto-fix-failed-logs.txt
gh run view "$RUN_ID" --json conclusion,status,name,headBranch,headSha,jobs > .auto-fix-run-summary.json
PR_NUMBER=$(gh pr list --head "${{ github.event.workflow_run.head_branch }}" --json number --jq '.[0].number' 2>/dev/null || echo "")
echo "pr_number=$PR_NUMBER" >> "$GITHUB_OUTPUT"
echo "run_id=$RUN_ID" >> "$GITHUB_OUTPUT"
RECENT_FIX=$(git log --oneline -5 --format='%s' | grep -c 'fix:.*resolve CI failure' || true)
echo "recent_fix_count=$RECENT_FIX" >> "$GITHUB_OUTPUT"
- name: Skip if already attempted
if: steps.context.outputs.recent_fix_count != '0'
run: echo "::notice::Skipping - recent auto-fix commit exists"
- name: Analyze and fix with Claude
if: steps.context.outputs.recent_fix_count == '0'
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
direct_prompt: |
<analysis-and-fix-prompt>
additional_permissions: |
Read
Write
Edit
Grep
Glob
Bash(git *)
Bash(gh *)
workflow_run (failure)
|
v
Gather logs & context
|
v
Claude analyzes failure
|
+---+---+
| |
v v
Fixable Complex/External
| |
v v
Fix & Open issue
push with analysis
| |
v v
Comment Comment on PR
on PR linking issue
| Guard | Purpose |
|---|---|
actor.type != 'Bot' | Prevent bot-triggered loops |
head_branch != 'main' | Never auto-fix main branch directly |
| Recent fix check | Skip if auto-fix already attempted |
| Concurrency group | One auto-fix per branch at a time |
max-turns 30 | Limit Claude's iteration count |
| Requirement | How to set up |
|---|---|
CLAUDE_CODE_OAUTH_TOKEN | Repository secret with Claude Code OAuth token |
contents: write permission | Included in workflow permissions |
pull-requests: write permission | Included in workflow permissions |
issues: write permission | For creating issues on complex failures |
| Context | Command |
|---|---|
| Check recent failures | gh run list --status failure --json name,headBranch,conclusion -L 10 |
| Get failed logs | gh run view <id> --log-failed | tail -500 |
| Run summary | gh run view <id> --json conclusion,status,jobs |
| Find associated PR | gh pr list --head <branch> --json number --jq '.[0].number' |
| List workflow names | grep -h '^name:' .github/workflows/*.yml |