| name | github |
| version | 1.1.0 |
| updated | "2026-02-01T00:00:00.000Z" |
| description | GitHub CLI (gh) and GitHub Actions workflow development. This skill should be used when working with gh commands (PRs, issues, releases, API), writing GitHub Actions workflows, configuring workflow triggers/jobs/steps, optimizing CI/CD pipelines with caching/parallelization, reducing action minutes, matrix builds, self-hosted runners, debugging workflow failures, setting up Node.js/npm/pnpm/yarn with actions/setup-node, or caching Playwright/Cypress browsers. |
GitHub
Overview
Comprehensive GitHub development covering the gh CLI for repository operations and GitHub Actions for CI/CD automation, with emphasis on workflow optimization and cost reduction.
gh CLI Quick Reference
Authentication and common operations:
gh auth login
gh auth status
gh auth token
gh pr create --fill
gh pr create --base main --head feature --title "Title" --body "Body"
gh pr list --state open
gh pr view 123
gh pr checkout 123
gh pr merge 123 --squash
gh issue create --title "Bug" --body "Description" --label bug
gh issue list --assignee @me
gh issue close 123 --reason completed
gh release create v1.0.0 --generate-notes
gh release upload v1.0.0 ./dist/*
gh api repos/{owner}/{repo}/actions/runs --jq '.workflow_runs[].status'
gh api graphql -f query='{ viewer { login } }'
See gh-cli.md for complete command reference.
GitHub Actions Workflow Structure
name: CI
on:
push:
branches: [main]
paths-ignore: ['**.md']
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
- run: npm test
See actions-triggers-jobs.md and actions-steps-expressions.md for triggers, contexts, expressions, and job configuration.
Optimization Strategies
1. Caching (Biggest Impact)
- uses: actions/setup-node@v4
with:
cache: 'npm'
- uses: actions/cache@v4
with:
path: |
~/.cache
.build
key: ${{ runner.os }}-build-${{ hashFiles('**/lockfile') }}
restore-keys: |
${{ runner.os }}-build-
2. Parallelization
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [18, 20, 22]
runs-on: ${{ matrix.os }}
test-shard:
strategy:
matrix:
shard: [1, 2, 3, 4]
steps:
- run: npm test -- --shard=${{ matrix.shard }}/4
3. Early Termination
on:
push:
paths:
- 'src/**'
- 'package.json'
paths-ignore:
- '**.md'
- 'docs/**'
jobs:
deploy:
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: "!contains(github.event.head_commit.message, '[skip ci]')"
4. Reduce Minutes
| Technique | Savings |
|---|
Use ubuntu-latest over macos-latest | 10x cheaper |
Shallow clone: fetch-depth: 1 | Faster checkout |
| Cache dependencies | 50-80% faster installs |
| Parallel matrix jobs | Wall-clock time |
timeout-minutes on jobs | Prevent runaways |
concurrency.cancel-in-progress | Kill stale runs |
See optimization-caching.md and optimization-workflows.md for advanced patterns including Docker layer caching, artifact strategies, and self-hosted runner optimization.
Common Patterns
Reusable Workflows
on:
workflow_call:
inputs:
node-version:
type: string
default: '20'
jobs:
build:
uses: ./.github/workflows/reusable-build.yml
with:
node-version: '22'
Composite Actions
name: 'Setup'
runs:
using: composite
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- run: npm ci
shell: bash
Job Dependencies
jobs:
build:
test:
needs: build
deploy:
needs: [build, test]
if: success()
Debugging Workflows
env:
ACTIONS_STEP_DEBUG: true
- run: echo '${{ toJSON(github) }}'
- run: echo '${{ toJSON(env) }}'
- uses: mxschmitt/action-tmate@v3
if: failure()
Local testing with act:
act push
act -j build
act --secret-file .secrets
Resources
- gh-cli.md - Complete gh command reference
- actions-triggers-jobs.md - Workflow triggers, concurrency, jobs, matrix, runners, services
- actions-steps-expressions.md - Steps, conditionals, contexts, expressions, secrets, artifacts
- optimization-caching.md - Dependency caching, build cache, Docker layer caching
- optimization-workflows.md - Parallelization, path filters, conditional jobs, checkout optimization
- nodejs.md - Node.js/npm/pnpm/yarn setup, Playwright/Cypress caching, monorepo patterns