github-actions-ci
Skill1 starsChanged 7 months agoMITView on GitHub
Production GitHub Actions patterns — matrix builds, caching, OIDC to AWS/GCP, reusable workflows, secrets discipline, concurrency control, and the small fixes that turn 12-minute CI into 3-minute CI. Use when setting up CI for a new repo, optimizing slow workflows, or hardening secrets posture.
- Installs packages
4 other projects use a version of this.
Adopted by
Most recently taken up by
- gregwebs/skills-sdlctheir own version, first seen Sep 29, 2026
- cvsz/zomegatheir own version, first seen Sep 2, 2026
- techdeveloper-org/mcp-jenkins-citheir own version, first seen Aug 12, 2026
- THEROCKSSS/hermes-skills-portfoliotheir own version, first seen Aug 3, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- gregwebs/skills-sdlc★ 17same name
- cvsz/zomega★ 1same name
- THEROCKSSS/hermes-skills-portfolio★ 1same name
- techdeveloper-org/mcp-jenkins-ci★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository50 other files it gives its agents.
- algolia-searchSkill
- audit-tautological-testsSkill
- blame-archaeologySkill
- brevo-emailSkill
- bun-runtimeSkill
- clerk-authSkill
- cloudflare-workersSkill
- dbt-data-modelingSkill
- explain-this-diffSkill
- extract-skill-from-sessionSkill
- fastapi-productionSkill
- find-dead-codeSkill
- find-real-bugSkill
- gdpr-dpiaSkill
- graphql-relaySkill
- grpc-servicesSkill
- hipaa-auditSkill
- india-dpdp-actSkill
- java-8-to-21Skill
- jest-to-vitestSkill
- kubernetes-helmSkill
- mongo-to-postgresSkill
- nextjs-pages-to-appSkill
- node-version-upgradeSkill
- opentelemetry-instrumentSkill
- pci-dss-checklistSkill
- plan-the-rollbackSkill
- python-2-to-3Skill
- razorpay-integrationSkill
- react-native-expoSkill
- scaffold-cli-toolSkill
- scaffold-fullstack-appSkill
- scaffold-go-microserviceSkill
- scaffold-new-appSkill
- scaffold-saas-starterSkill
- sentry-monitoringSkill
- shrink-this-prSkill
- soc2-evidenceSkill
- spec-from-conversationSkill
- stripe-integrationSkill
- supabase-backendSkill
- terraform-patternsSkill
- threat-modeling-strideSkill
- triage-stack-traceSkill
- wcag-accessibility-auditSkill
- webpack-to-viteSkill
- write-adrSkill
- write-commit-messageSkill
- write-pr-descriptionSkill
- write-runbookSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 165
runs-on: ubuntu-22.04: instead of ubuntu-latest if you need predictable behavior.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
GitHub Actions CI
GitHub Actions is the dominant CI for new projects. The official docs cover features in isolation; this skill covers how to compose them for a fast, secure, maintainable CI.
When to use
- New repo, setting up CI from scratch.
- Existing CI is slow (>5 min for a backend; >2 min for a frontend lib).
- Migrating from Travis/CircleCI/Jenkins.
- Hardening secrets after a leak / audit finding.
When NOT to use
- Self-hosted runners with strict isolation needs at scale → look at Buildkite or Argo Workflows.
- Monorepo with 50+ services and complex DAG → Bazel + Bazel-cache is faster.
The principles
- Cache aggressively, invalidate explicitly. A 5-min CI is usually 4 min of dependency installs.
- OIDC always, long-lived secrets never. Federate to AWS/GCP/Azure; keep secrets only for things without an OIDC story (npm token, Docker Hub).
- Concurrency cancels in-flight on push. Push 3 commits in 30s → 1 run, not 3.
- One reusable workflow per shape. "Build & test a Node app" is one file consumed by 12 repos via
uses:. - Pin to SHAs in security-sensitive jobs.
actions/checkout@v4→actions/checkout@b4ffde65.... Tags can be moved.
Standard Node/TS workflow (well-cached)
# .github/workflows/ci.yml
name: ci
on:
pull_request:
push:
branches: [main]
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 15
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: 9 }
- uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck
- run: pnpm lint
- run: pnpm test
- run: pnpm buildKey bits:
concurrencywithcancel-in-progress— pushing more commits cancels the older run on PR branches but never onmain(where you want a clean record).cache: pnpminsetup-node— persists~/.pnpm-storekeyed onpnpm-lock.yaml. Saves ~60s per run.--frozen-lockfile— fails if lockfile is out of sync, surfacing dependency drift early.timeout-minutes— runaway jobs don't burn 6 hours of credits.permissions: contents: read— start with least privilege, grant per-job below.
Matrix build (one job, many configs)
jobs:
test:
strategy:
fail-fast: false # don't cancel siblings on first failure
matrix:
node: [18, 20, 22]
os: [ubuntu-latest, macos-latest, windows-latest]
exclude:
- { os: windows-latest, node: 18 } # skip combos you don't ship
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: ${{ matrix.node }} }
- run: npm ci
- run: npm testfail-fast: false is non-obvious — default is true, which kills sibling jobs as soon as one fails. Half-information runs help nobody.
OIDC to AWS (no long-lived keys)
deploy:
needs: ci
runs-on: ubuntu-latest
permissions:
id-token: write # required for OIDC
contents: read
steps:
- uses: actions/checkout@v4
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::123456789012:role/github-deploy
aws-region: us-east-1
- run: aws s3 sync ./out s3://my-bucketThe IAM role's trust policy condition restricts to your repo + branch:
{
"StringEquals": { "token.actions.githubusercontent.com:aud": "sts.amazonaws.com" },
"StringLike": { "token.actions.githubusercontent.com:sub": "repo:acme/myrepo:ref:refs/heads/main" }
}No AWS_ACCESS_KEY_ID in GitHub secrets → no rotation, no leak risk.
Reusable workflow (shared across repos)
# In acme/.github repo: .github/workflows/node-app.yml
name: node-app
on:
workflow_call:
inputs:
node-version: { type: string, default: '20' }
pnpm-version: { type: string, default: '9' }
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with: { version: ${{ inputs.pnpm-version }} }
- uses: actions/setup-node@v4
with: { node-version: ${{ inputs.node-version }}, cache: pnpm }
- run: pnpm install --frozen-lockfile
- run: pnpm typecheck && pnpm lint && pnpm test && pnpm build# Each consuming repo: .github/workflows/ci.yml
on: [push, pull_request]
jobs:
ci:
uses: acme/.github/.github/workflows/node-app.yml@main
with:
node-version: '22'12 repos, 1 workflow, 1 review per change. Big win on a small team.
Speed tricks
- Docker layer cache — use
docker/build-push-actionwithcache-from: type=ghaandcache-to: type=gha,mode=max. - Parallelize independent steps as separate
jobs:not sequentialsteps:. Free CPU, free wall-clock. - Restore-only cache for flaky builds —
actions/cache/restore@v4thenactions/cache/save@v4only onmain. Avoids each PR poisoning cache. runs-on: ubuntu-22.04instead ofubuntu-latestif you need predictable behavior.latestfloats.paths:filter onon: pull_request:— don't run frontend CI for backend-only PRs.
Secrets posture
permissions: # repo-wide default in GH settings: read-only
contents: read
# Per-job grants only:
publish:
permissions:
contents: write # to push tags
packages: write # to push to ghcr
id-token: write # OIDC
steps:
- run: echo "${{ secrets.NPM_TOKEN }}" | npm login --auth-type=legacyGitHub repo setting → "Default workflow permissions: Read repository contents and packages permissions". Then grant up per-job.
Anti-patterns
AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEYin repo secrets — long-lived, leakable, you forget to rotate. Use OIDC.pull_request_targetwithout understanding the security model — it runs with repo secrets on the base branch but checks out the PR's code. Easy to leak secrets to a fork.actions/checkout@main— supply chain risk. Pin to a tag or SHA.- No
concurrency:group — every push spawns a run; old runs eat minutes for nothing. fail-fast: true(default) on matrix — partial signal that wastes a re-run.- Caching
node_modules— non-portable across Node versions, often slower than re-installing from a~/.pnpm-storecache. - One giant 1000-line workflow file — split into reusable workflows or per-purpose files.
run: |with unquoted variables — shell injection from PR titles, branch names. Always quote:run: echo "$TITLE"notrun: echo $TITLE.- Using
set-output(deprecated) — use$GITHUB_OUTPUTredirection. - Self-hosted runners on default config — they cache previous job state. Without isolation, one PR can poison the next.
Verify it worked
- CI runs in under 5 min for a typical Node backend (median).
- Cache hit rate > 80% (visible in Actions logs).
- Pushing 3 commits to a PR in 1 min results in 1 successful run, not 3.
- No
AWS_ACCESS_KEY_ID/GCP_SA_KEYsecrets in repo settings. - Default workflow permissions are
read; jobs grant up explicitly. - Failing one matrix cell does not cancel the others.
- Reusable workflow consumed by ≥ 2 repos and updated by changing one file.
- Untrusted PRs (forks) cannot read repo secrets.
- All third-party actions are pinned to tags or SHAs (no
@main). timeout-minutesset on every long-running job.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

