GitHub Actions workflow management with specialized agent and gh CLI skill.
The GitHub Actions plugin provides comprehensive CI/CD pipeline management for GitHub repositories. It includes:
- Workflow Creation - Design and implement GitHub Actions workflows
- Optimization - Improve workflow performance and reliability
- Troubleshooting - Debug failed workflows and jobs
- Matrix Builds - Configure multi-platform and multi-version testing
- Secrets Management - Handle sensitive data securely
- gh CLI Skill - GitHub CLI commands for workflow management
-
GitHub CLI (
gh)- Install:
brew install gh(macOS) or GitHub CLI installation - Authenticate:
gh auth login
- Install:
-
GitHub Repository
- Repository with Actions enabled
- Appropriate permissions for workflow management
# Add marketplace (if not already added)
/plugin marketplace add claude-code-plugins
# Install github-actions plugin
/plugin install github-actions@crewchiefAfter installation, restart Claude Code to activate the plugin.
Expert agent for GitHub Actions workflows with capabilities:
Workflow Creation:
- Design CI/CD pipelines for any tech stack
- Configure workflow triggers (push, pull_request, schedule, etc.)
- Set up matrix builds for multi-platform testing
- Implement caching strategies for dependencies
Optimization:
- Reduce workflow runtime
- Implement parallel job execution
- Configure artifact caching
- Optimize Docker layer caching
Troubleshooting:
- Debug workflow failures
- Analyze job logs
- Fix syntax errors in YAML
- Resolve permission issues
Security:
- Manage secrets and environment variables
- Configure OIDC for cloud deployments
- Implement least-privilege permissions
- Audit workflow security
Example Usage:
@github-actions-specialist Create a CI workflow for a TypeScript project that runs tests and builds on Node 18 and 20
The gh-cli skill provides guidance for using the GitHub CLI to manage workflows.
Authentication Check:
Before using any gh commands, always verify authentication:
gh auth statusIf not authenticated, run gh auth login first.
Common Commands:
# List workflows
gh workflow list
# List recent workflow runs
gh run list
# View run details and logs
gh run view <run-id> --log-failed
# Trigger a workflow
gh workflow run <workflow-name>
# Rerun failed jobs
gh run rerun <run-id> --failed
# View PR checks
gh pr checksSee skills/gh-cli/SKILL.md for complete documentation.
-
Ask the specialist to create a workflow:
@github-actions-specialist Create a Node.js CI workflow that: - Runs tests on Node 18 and 20 - Caches npm dependencies - Uploads coverage reports - Runs on every push and PR -
The agent will:
- Create
.github/workflows/ci.yml - Configure jobs, steps, and caching
- Add appropriate triggers
- Include best practices
- Create
-
Commit and push:
git add .github/workflows/ci.yml git commit -m "ci: add Node.js CI workflow" git push
-
Check gh CLI authentication:
gh auth status
-
List failed runs:
gh run list --status=failure
-
View failed job logs:
gh run view <run-id> --log-failed
-
Ask the specialist to fix:
@github-actions-specialist Fix the workflow based on this error: [paste error]
-
Request optimization:
@github-actions-specialist Optimize the ci.yml workflow to reduce runtime -
The agent will:
- Analyze current workflow structure
- Identify bottlenecks
- Suggest parallelization opportunities
- Implement caching strategies
- Update workflow file
Node.js/TypeScript:
- Lint, test, build on multiple Node versions
- Upload coverage to Codecov
- Publish to npm registryPython:
- Test on multiple Python versions
- Run pytest with coverage
- Build and publish to PyPIRust:
- Build and test with cargo
- Cross-compile for multiple platforms
- Cache cargo dependenciesDocker:
- Build multi-arch images
- Push to Docker Hub or GHCR
- Scan for vulnerabilitiesConfigure testing across multiple dimensions:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [18, 20]Improve workflow speed with caching:
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}Secure handling of sensitive data:
env:
API_KEY: ${{ secrets.API_KEY }}- Keep workflows simple and focused
- Use reusable workflows for common patterns
- Implement proper error handling
- Add meaningful job and step names
- Cache dependencies aggressively
- Run jobs in parallel when possible
- Use appropriate runner types (ubuntu, macos, windows)
- Implement conditional job execution
- Never commit secrets to repository
- Use GITHUB_TOKEN for API access
- Implement least-privilege permissions
- Audit third-party actions
- Add timeout limits to jobs
- Implement retry logic for flaky tests
- Use matrix builds for cross-platform testing
- Monitor workflow run times
ERROR: GitHub CLI is not authenticated
Solution: Run gh auth login and follow the prompts.
- Check workflow triggers in YAML
- Verify branch/path filters
- Ensure workflow file is in
.github/workflows/ - Check repository permissions
- Review job logs via
gh run view <id> --log-failed - Check action versions
- Verify secrets are configured
- Test steps locally when possible
- Enable caching for dependencies
- Reduce job concurrency if hitting limits
- Use self-hosted runners for private repos
- Optimize Docker builds with layer caching
- Check GITHUB_TOKEN permissions
- Verify repository settings
- Add required permissions to workflow
- Check organization security policies
# GitHub CLI authentication (handled by gh auth login)
GH_TOKEN=<your-github-token>Current version: 0.1.0
github-actions, ci-cd, workflows, automation, gh-cli, github
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test
- run: npm run buildjobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [18, 20]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- run: npm ci
- run: npm testjobs:
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/build-push-action@v4
with:
push: true
tags: ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max