Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Write GitHub Actions workflows with proper syntax, reusable workflows, composite actions, matrix builds, caching, and security best practices. Use when creating CI/CD workflows for GitHub-hosted projects or automating GitHub repository tasks.
.claude/skills/ancoleman-writing-github-actions/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-17 | ✗→✓ | ▲ Improved | 141% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 100% | 0% |
| case-21 | ✓→✗ | ▼ Worse | 100% | 0% |
| case-19 | ✓→✓ | = Same ✓ | 218% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 211% | 0% |
Create GitHub Actions workflows for CI/CD pipelines, automated testing, deployments, and repository automation using YAML-based configuration with native GitHub integration.
GitHub Actions is the native CI/CD platform for GitHub repositories. This skill covers workflow syntax, triggers, job orchestration, reusable patterns, optimization techniques, and security practices specific to GitHub Actions.
Core Focus:
Not Covered:
building-ci-pipelinesgitops-workflowsinfrastructure-as-codetesting-strategiesTrigger this skill when:
yamlname: CI on: push: branches: [main] pull_request: branches: [main] jobs: test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' - run: npm ci - run: npm test
Key Components:
name: Workflow display nameon: Trigger events (push, pull_request, schedule, workflow_dispatch)jobs: Job definitions (run in parallel by default)runs-on: Runner type (ubuntu-latest, windows-latest, macos-latest)steps: Sequential operations (uses actions or run commands)yaml# Code events on: push: branches: [main, develop] paths: ['src/**'] pull_request: types: [opened, synchronize, reopened] # Manual trigger on: workflow_dispatch: inputs: environment: type: choice options: [dev, staging, production] # Scheduled on: schedule: - cron: '0 2 * * *' # Daily at 2 AM UTC
For complete trigger reference, see references/triggers-events.md.
Use Reusable Workflow when:
Use Composite Action when:
| Feature | Reusable Workflow | Composite Action | |---------|------------------|------------------| | Scope | Complete job | Step sequence | | Trigger | workflow_call | uses: in step | | Secrets | Inherit by default | Must pass explicitly | | File Sharing | Requires artifacts | Same runner/workspace |
For detailed patterns, see references/reusable-workflows.md and references/composite-actions.md.
Use Built-in Setup Action Caching (Recommended):
yaml- uses: actions/setup-node@v4 with: node-version: '20' cache: 'npm' # or 'yarn', 'pnpm'
Available for: Node.js, Python (pip), Java (maven/gradle), .NET, Go
Use Manual Caching when:
yaml- uses: actions/cache@v4 with: path: ~/.npm key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-deps-
For optimization techniques, see references/caching-strategies.md.
Use GitHub-Hosted Runners when:
Use Self-Hosted Runners when:
yamljobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v5 - run: npm run build - uses: actions/upload-artifact@v4 with: name: dist path: dist/ test: needs: build runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v5 with: name: dist - run: npm test deploy: needs: [build, test] if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest environment: production steps: - uses: actions/download-artifact@v5 - run: ./deploy.sh
Key Elements:
needs: creates job dependencies (sequential execution)if: enables conditional executionenvironment: enables protection rules and environment secretsyamljobs: test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] node: [18, 20, 22] steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - run: npm test
Result: 9 jobs (3 OS × 3 Node versions)
For advanced matrix patterns, see examples/matrix-build.yml.
yaml# Cancel in-progress runs on new push concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true # Single deployment per environment jobs: deploy: concurrency: group: production-deployment cancel-in-progress: false steps: [...]
File: .github/workflows/reusable-build.yml
yamlname: Reusable Build on: workflow_call: inputs: node-version: type: string default: '20' secrets: NPM_TOKEN: required: false outputs: artifact-name: value: ${{ jobs.build.outputs.artifact }} jobs: build: runs-on: ubuntu-latest outputs: artifact: build-output steps: - uses: actions/checkout@v5 - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} - run: npm ci && npm run build - uses: actions/upload-artifact@v4 with: name: build-output path: dist/
yamljobs: build: uses: ./.github/workflows/reusable-build.yml with: node-version: '20' secrets: inherit # Same org only
For complete reusable workflow guide, see references/reusable-workflows.md.
File: .github/actions/setup-project/action.yml
yamlname: 'Setup Project' description: 'Install dependencies and setup environment' inputs: node-version: description: 'Node.js version' default: '20' outputs: cache-hit: value: ${{ steps.cache.outputs.cache-hit }} runs: using: "composite" steps: - uses: actions/setup-node@v4 with: node-version: ${{ inputs.node-version }} cache: 'npm' - id: cache uses: actions/cache@v4 with: path: node_modules key: ${{ runner.os }}-deps-${{ hashFiles('**/package-lock.json') }} - if: steps.cache.outputs.cache-hit != 'true' shell: bash run: npm ci
Key Requirements:
runs.using: "composite" marks action typeshell: required for all run steps${{ inputs.name }}yamlsteps: - uses: actions/checkout@v5 - uses: ./.github/actions/setup-project with: node-version: '20' - run: npm run build
For detailed composite action patterns, see references/composite-actions.md.
yamljobs: deploy: runs-on: ubuntu-latest environment: production # Uses environment secrets steps: - env: API_KEY: ${{ secrets.API_KEY }} run: ./deploy.sh
yamljobs: deploy: runs-on: ubuntu-latest permissions: id-token: write # Required for OIDC contents: read steps: - uses: aws-actions/configure-aws-credentials@v4 with: role-to-assume: arn:aws:iam::123456789012:role/GitHubActionsRole aws-region: us-east-1 - run: aws s3 sync ./dist s3://my-bucket
yaml# Workflow-level permissions: contents: read pull-requests: write # Job-level jobs: deploy: permissions: contents: write deployments: write steps: [...]
yaml# Pin to commit SHA (not tags) - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v5.0.0
Enable Dependabot:
File: .github/dependabot.yml
yamlversion: 2 updates: - package-ecosystem: "github-actions" directory: "/" schedule: interval: "weekly"
For comprehensive security guide, see references/security-practices.md.
Use built-in caching in setup actions (cache: 'npm'), run independent jobs in parallel, add conditional execution with if:, and minimize checkout depth (fetch-depth: 1).
For detailed optimization strategies, see references/caching-strategies.md.
Common contexts: github.*, secrets.*, inputs.*, matrix.*, runner.*
yaml- run: echo "Branch: ${{ github.ref }}, Event: ${{ github.event_name }}"
For complete syntax reference, see references/workflow-syntax.md.
For comprehensive coverage of specific topics:
Complete workflow templates ready to use:
building-ci-pipelines - CI/CD pipeline design strategygitops-workflows - GitOps deployment patternsinfrastructure-as-code - Terraform/Pulumi integrationtesting-strategies - Test frameworks and coveragesecurity-hardening - SAST/DAST toolsgit-workflows - Understanding branches and PRs| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-19 | pass→pass | 7,125 | 4,601 | -35% | 1 | 1 | 0% | 1,182 | 3,754 | +218% | 0 | 0 | — |
case-01 | pass→pass | 7,092 | 9,789 | +38% | 1 | 1 | 0% | 1,283 | 3,991 | +211% | 0 | 0 | — |
case-02 | pass→pass | 3,992 | 4,090 | +2% | 1 | 1 | 0% | 613 | 3,821 | +523% | 0 | 0 | — |
case-03 | pass→pass | 2,878 | 3,951 | +37% | 1 | 1 | 0% | 466 | 3,744 | +703% | 0 | 0 | — |
case-04 | pass→pass | 8,546 | 4,822 | -44% | 1 | 1 | 0% | 1,436 | 3,900 | +172% | 0 | 0 | — |
case-05 | pass→pass | 10,635 | 7,643 | -28% | 1 | 1 | 0% | 1,824 | 4,560 | +150% | 0 | 0 | — |
case-06 | pass→pass | 7,566 | 7,248 | -4% | 1 | 1 | 0% | 1,230 | 4,378 | +256% | 0 | 0 | — |
case-07 | pass→pass | 10,283 | 7,385 | -28% | 1 | 1 | 0% | 1,912 | 4,424 | +131% | 0 | 0 | — |
case-08 | pass→pass | 9,639 | 5,211 | -46% | 1 | 1 | 0% | 1,634 | 4,031 | +147% | 0 | 0 | — |
case-09 | pass→pass | 12,063 | 5,811 | -52% | 1 | 1 | 0% | 1,772 | 4,109 | +132% | 0 | 0 | — |
case-10 | pass→pass | 3,054 | 2,860 | -6% | 1 | 1 | 0% | 483 | 3,666 | +659% | 0 | 0 | — |
case-11 | pass→pass | 10,275 | 6,524 | -37% | 1 | 1 | 0% | 1,874 | 4,153 | +122% | 0 | 0 | — |
case-12 | pass→pass | 2,761 | 2,303 | -17% | 1 | 1 | 0% | 438 | 3,531 | +706% | 0 | 0 | — |
case-13 | pass→pass | 5,413 | 3,863 | -29% | 1 | 1 | 0% | 916 | 3,770 | +312% | 0 | 0 | — |
case-14 | pass→pass | 8,375 | 7,166 | -14% | 1 | 1 | 0% | 1,370 | 4,399 | +221% | 0 | 0 | — |
case-15 | pass→pass | 6,629 | 4,729 | -29% | 1 | 1 | 0% | 1,110 | 3,914 | +253% | 0 | 0 | — |
case-16 | pass→pass | 7,719 | 6,270 | -19% | 1 | 1 | 0% | 1,390 | 4,210 | +203% | 0 | 0 | — |
case-17 | fail→pass | 9,997 | 6,051 | -39% | 1 | 1 | 0% | 1,725 | 4,154 | +141% | 0 | 0 | — |
case-18 | pass→pass | 5,014 | 4,935 | -2% | 1 | 1 | 0% | 926 | 3,993 | +331% | 0 | 0 | — |
case-20 | pass→fail | 20,034 | 20,020 | -0% | 1 | 1 | 0% | 3,088 | 6,171 | +100% | 0 | 0 | — |
case-21 | pass→fail | 15,963 | 22,972 | +44% | 1 | 1 | 0% | 2,730 | 5,451 | +100% | 0 | 0 | — |
case-22 | pass→pass | 9,607 | 7,299 | -24% | 1 | 1 | 0% | 1,786 | 4,439 | +149% | 0 | 0 | — |
case-23 | pass→pass | 18,283 | 15,264 | -17% | 1 | 1 | 0% | 3,251 | 5,904 | +82% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of -33 percentage points is the difference between those two pass rates over the 23 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.