agentleFS
SkillMedevSkillMedev/devops-platform-engineer/skills/github-actions/SKILL.md

github-actions

Skill0 starsChanged 38 days agoMITView on GitHub

Designs and hardens GitHub Actions CI/CD - pipelines that hit a sub-10-minute PR feedback budget through caching and parallelism, with least-privilege security and safe deploy gates. Use when someone asks "why is my CI so slow", "how do I cache node_modules properly", "set up a deploy workflow", "is pull_request_target safe here", or wants a workflow written or reviewed. Do NOT use for provisioning the cloud infrastructure the pipeline deploys to - use terraform-expert instead; do NOT use for Vercel-specific deploy flows - use vercel-deploy-pipeline instead; for secret storage policy beyond CI, use secrets-hygiene.

48 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use react-native-brownfield-migration, gitlab-ci and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • maikotrindadeSkill

    react-native-brownfield-migration

    Provides an incremental adoption strategy to migrate native iOS or Android apps to React Native or Expo using @callstack/react-native-brownfield for initial setup. Use when planning migration steps, packaging XCFramework/AAR artifacts, and integrating them into host apps.

    Also in 4 projects that use this

  • jcsaaddupuySkill

    gitlab-ci

    GitLab CI/CD configuration guide

    Also in 3 projects that use this

  • maikotrindadeSkill

    upgrading-react-native

    Upgrades React Native apps to newer versions by applying rn-diff-purge template diffs, updating package.json dependencies, migrating native iOS and Android configuration, resolving CocoaPods and Gradle changes, and handling breaking API updates. Use when upgrading React Native, bumping RN version, updating from RN 0.x to 0.y, or migrating Expo SDK alongside a React Native upgrade.

    Also in 3 projects that use this

  • rogue-dev-studioSkill

    nodejs

    Node.js development environment. Use when the project needs this capability or the user / team manifest asks for it. Use for specialized `nodejs` work when listed in TEAM.yaml or explicitly requested.

    Also in 4 projects that use this

  • Sorcha-PlatformSkill

    grpc

    Build or review gRPC services and clients in .NET. USE FOR: ASP.NET Core gRPC, protobuf contracts, unary or streaming RPC, gRPC client factory, interceptors, deadlines, cancellation, channel reuse, backend service integration. DO NOT USE FOR: broad browser-facing APIs without gRPC-Web tradeoff review, SignalR realtime hubs, plain REST APIs. INVOKES: dotnet build/test and focused service or client smoke checks when code changes.

    Also in 3 projects that use this

  • ihiteshguptaSkill

    terraform

    Expert in Infrastructure as Code with Terraform. Use for creating, managing, and versioning infrastructure across cloud providers.

    Also in 5 projects that use this

The file

Show its rules and text

We split this skill into the rules it gives an agent

15 rules. 0 are common, 7 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 37 edited versions we read keep these.

  • 7

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No single job over 10 minutes.

    line 24
  2. Very specific:

    Run independent jobs (lint, typecheck, unit, build) in parallel.

    line 30
  3. Distinctive:

    Use concurrency groups to cancel superseded runs on the same branch.

    line 32
  4. Very specific:

    Use the built-in cache in setup-node/setup-python for dependencies - the biggest, easiest win.

    line 37
  5. Distinctive:

    Never cache things that are faster to recreate than to download (small artifacts), and never cache secrets or credentials into a cache …

    line 40
  6. Very specific:

    Never echo secrets; pass via the secrets context, not interpolated into run args where they hit logs and shell history.

    line 46
  7. Very specific:

    Treat pull_request_target as loaded: it runs with a write token against untrusted fork code.

    line 47
  8. Distinctive:

    Use OIDC to assume short-lived cloud roles instead of long-lived cloud keys stored as secrets.

    line 53
  9. Very specific:

    Do not pin actions to @v4-style tags in anything with secrets or write permissions - pin the SHA.

    line 127
  10. Very specific:

    Do not run untrusted PR code under pull_request_target or with elevated permissions.

    line 128
  11. Very specific:

    Do not serialize jobs with needs for readability.

    line 129
  12. Distinctive:

    Do not blanket-retry flaky tests - a retried-green suite hides real races.

    line 130
  13. Distinctive:

    Do not store long-lived cloud keys when OIDC is available.

    line 131
  14. Very specific:

    Do not let a job run unbounded - always set timeout-minutes, or a hung job burns 6 hours of runner time.

    line 132
  15. Distinctive:

    Every third-party action SHA-pinned.

    line 137

“Common” is measured: kept by at least 6 in 10 of the 37 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

GitHub Actions

CI that takes 25 minutes gets ignored, and a workflow with a write-token running untrusted code gets owned. This skill builds pipelines against two hard constraints at once - a speed budget developers will actually wait for, and a security posture that assumes PR authors are hostile - because retrofitting either into a sprawling workflow file is far more painful than starting right.

Operating procedure

Step 1: Gather inputs

  • Stack and package manager (locks the caching strategy).
  • Current wall-clock time of the slowest required check, and the test-suite runtime.
  • Monorepo or single package; deploy targets and who may approve prod.
  • Any use of forked PRs or pull_request_target today (security review trigger).

Step 2: Set the budgets

  • PR feedback (all required checks) under 10 minutes wall-clock; under 5 is the mark of a healthy repo. Anything over 15 minutes changes developer behavior - people batch commits and stop running CI-first.
  • No single job over 10 minutes; split or parallelize past that.
  • Dependency-install step under 60 seconds on a warm cache; if npm ci runs 3+ minutes every build, caching is broken.
  • Cache hit rate above 90% on PR builds. Check the cache step's output over a week of runs; a low rate means the key is too specific or the cache is thrashing the 10GB-per-repo eviction limit.

Step 3: Structure jobs for parallelism

  • Run independent jobs (lint, typecheck, unit, build) in parallel; use needs only for real data dependencies, not for tidiness - every unnecessary needs serializes the graph.
  • Shard test suites over ~5 minutes across matrix jobs.
  • Use concurrency groups to cancel superseded runs on the same branch.
  • Monorepo: trigger by changed paths (path filters or affected-detection like Turborepo/Nx) so a docs change does not run the mobile build.

Step 4: Caching

  • Use the built-in cache in setup-node/setup-python for dependencies - the biggest, easiest win.
  • For custom caches, key on the lockfile hash with a restore-keys prefix fallback, so a lockfile change still restores the nearest cache instead of starting cold: key os-node-${{ hashFiles('**/package-lock.json') }}, restore-key os-node-.
  • Cache build outputs (Turborepo/Nx remote cache) to skip unchanged work entirely.
  • Never cache things that are faster to recreate than to download (small artifacts), and never cache secrets or credentials into a cache readable by PR builds.

Step 5: Security hardening

  • Pin third-party actions to a full commit SHA, not a mutable tag - tags can be moved to malicious code.
  • Set least-privilege permissions: at the workflow level (default contents: read) and widen per-job only where needed.
  • Never echo secrets; pass via the secrets context, not interpolated into run args where they hit logs and shell history.
  • Treat pull_request_target as loaded: it runs with a write token against untrusted fork code. Never check out and execute the PR's code under it; if you must, split into an unprivileged pull_request job plus a privileged job that consumes only validated artifacts.
  • Forked PRs get no secrets - design required checks to pass without them.

Step 6: Deploys

  • Gate prod behind environments with required reviewers and protection rules.
  • Use OIDC to assume short-lived cloud roles instead of long-lived cloud keys stored as secrets.
  • Gate deploys on green tests via needs; never deploy from a workflow that skipped checks.

Step 7: Keep it maintainable

  • Extract repetition into reusable workflows and composite actions once the same steps appear a third time.
  • Fail loudly: no || true, no continue-on-error on required checks.
  • Quarantine flaky tests to a non-blocking job and fix them; do not blanket-retry the suite to green.

Worked artifact: workflow skeleton

Copy, replace the [FILL] fields, delete jobs you do not need.

name: CI
on:
  pull_request:
  push: { branches: [main] }

permissions:
  contents: read

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 10          # hard stop; budget is well under this
    steps:
      - uses: actions/checkout@[FILL: full commit SHA]
      - uses: actions/setup-node@[FILL: full commit SHA]
        with: { node-version: [FILL], cache: 'npm' }
      - run: npm ci
      - run: npm test -- --shard=${{ matrix.shard }}/[FILL: total shards]
    strategy:
      fail-fast: false
      matrix:
        shard: [FILL: e.g. 1, 2, 3]

  lint:
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - uses: actions/checkout@[FILL: full commit SHA]
      - uses: actions/setup-node@[FILL: full commit SHA]
        with: { node-version: [FILL], cache: 'npm' }
      - run: npm ci
      - run: npm run lint && npm run typecheck

  deploy:
    if: github.ref == 'refs/heads/main'
    needs: [test, lint]
    runs-on: ubuntu-latest
    environment: production        # required reviewers configured in repo settings
    permissions:
      contents: read
      id-token: write              # OIDC - no long-lived cloud keys
    steps:
      - uses: actions/checkout@[FILL: full commit SHA]
      - uses: [FILL: cloud OIDC auth action]@[FILL: full commit SHA]
        with: { role-to-assume: [FILL] }
      - run: [FILL: deploy command]

Matrix testing across versions/OS follows the same pattern - matrix: { node: [FILL versions], os: [ubuntu-latest, macos-latest] } with fail-fast: false when every combination should report.

Deliverable

Produce the workflow file(s) plus a one-page pipeline report: measured PR feedback time vs the 10-minute budget, cache hit rate, the job dependency graph, and a security checklist result (SHA pinning, permissions, pull_request_target audit, OIDC).

Do NOT

  • Do not pin actions to @v4-style tags in anything with secrets or write permissions - pin the SHA.
  • Do not run untrusted PR code under pull_request_target or with elevated permissions.
  • Do not serialize jobs with needs for readability; each false dependency adds minutes.
  • Do not blanket-retry flaky tests - a retried-green suite hides real races.
  • Do not store long-lived cloud keys when OIDC is available.
  • Do not let a job run unbounded - always set timeout-minutes, or a hung job burns 6 hours of runner time.

Quality bar

  • PR feedback under 10 minutes; every job has a timeout; cache hit rate above 90%.
  • Every third-party action SHA-pinned; workflow-level permissions read-only; secrets never appear in logs.
  • Prod deploys gated by environment protection and green checks, authenticated via OIDC.
  • Forked-PR runs pass without secrets; monorepo paths filter correctly; superseded runs auto-cancel.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.