agentleFS
StephanMeijerStephanMeijer/skills/skills/github-actions/SKILL.md

github-actions

Skill0 starsChanged 5 days agoMITView on GitHub

Write, review, harden, and debug GitHub Actions workflows and in-repository actions. Pins every action to a commit SHA in a lockfile with the gh actions-lock extension, grants least-privilege token permissions, closes script-injection and pull_request_target holes, keeps runs fast with caching, concurrency, and timeouts, and debugs failing runs from their logs with the gh CLI. Use when asked to add, change, review, secure, speed up, or fix a GitHub Actions workflow, CI pipeline, release or deploy job, composite or JavaScript action, Dependabot setup for actions, or a failing or flaky run. Do not use for other CI systems such as Forgejo Actions, GitLab CI, or Jenkins.

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

16 rules. 0 are common, 5 are distinctive, and 11 are very specific to this project.

  • 0

    Common

    Most of the 37 edited versions we read keep these.

  • 5

    Distinctive

    This author's own choices. Worth a look.

  • 11

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read every file under .github/workflows/, in-repository actions (action.yml anywhere), .github/dependabot.yml, …

    line 13
  2. Distinctive:

    Keep triggers, job names, and check names stable unless the user asks for a change.

    line 16
  3. Distinctive:

    Read references/security.md before writing or reviewing any workflow.

    line 20
  4. Very specific:

    Start from permissions: {} or contents: read at the top level and grant more per job only where a step needs it.

    line 22
  5. Very specific:

    Never interpolate untrusted ${{ }} expressions into run: scripts.

    line 23
  6. Very specific:

    Never check out or run pull request code in a pull_request_target or workflow_run job that has secrets or a write token.

    line 24
  7. Very specific:

    Prefer OIDC (id-token: write) over long-lived cloud credentials, and environments with required reviewers for deploys.

    line 25
  8. Distinctive:

    Do not onboard a repository without a lockfile unasked.

    line 37
  9. Very specific:

    Keep actions updated with Dependabot (package-ecosystem: github-actions).

    line 41
  10. Very specific:

    Add concurrency keyed on the workflow and ref, with cancel-in-progress: true for PR checks, never for deploys or releases.

    line 46
  11. Very specific:

    Use the setup actions' built-in caching (cache: on setup-node, setup-python, setup-go) or actions/cache keyed on lockfile hashes.

    line 48
  12. Very specific:

    Use a matrix only for dimensions the project supports.

    line 49
  13. Distinctive:

    Keep logic in repository scripts the developer can run locally.

    line 51
  14. Very specific:

    Run actionlint on every changed workflow.

    line 55
  15. Very specific:

    Run gh actions-lock --verify when the repository has a lockfile.

    line 56
  16. Distinctive:

    Run the commands the workflow calls locally, with the versions the workflow pins where practical.

    line 57

“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

Make workflows that do what the repository needs, with the least privilege and the fewest moving parts, and prove it with a real run. A workflow runs with the repository's token and secrets: treat every change as a security change.

Establish the Contract

  1. Read every file under .github/workflows/, in-repository actions (action.yml anywhere), .github/dependabot.yml, .github/workflows/actions.lock, and the repository's guidance (CONTRIBUTING, CLAUDE.md, AGENTS.md).
  2. Derive what the workflow must run from the repository's own commands: task runners, package scripts, Makefiles, documented build and test steps. Never invent a command that does not run locally.
  3. For an existing workflow, read its recent runs (gh run list --workflow <file>) and note durations, failures, and which checks branch protection requires. A required check that is renamed or removed blocks every PR.
  4. Keep triggers, job names, and check names stable unless the user asks for a change; rulesets and branch protection refer to them by name.

Apply the Security Policy

Read references/security.md before writing or reviewing any workflow. In short:

  • Start from permissions: {} or contents: read at the top level and grant more per job only where a step needs it.
  • Never interpolate untrusted ${{ }} expressions into run: scripts; pass them through env:.
  • Never check out or run pull request code in a pull_request_target or workflow_run job that has secrets or a write token.
  • Prefer OIDC (id-token: write) over long-lived cloud credentials, and environments with required reviewers for deploys.

Pin Actions with the Lockfile

GitHub's gh actions-lock extension pins every direct and transitive action dependency to an immutable commit SHA in .github/workflows/actions.lock, so action changes show up in PR diffs and moved tags are caught before they run. Check gh extension list for github/gh-actions-lock; if it is missing, ask the user to install it (gh extension install github/gh-actions-lock) rather than installing it yourself: it runs code from outside the repository with the user's token.

  • gh actions-lock scans all workflows, pins what it can, and writes the lockfile. Commit the lockfile with the workflow change that needed it.
  • gh actions-lock --verify is a read-only check that fails on an incomplete lockfile or a pin the runner would reject. Run it before every push that touches workflows, and add it to CI when the repository uses a lockfile.
  • gh actions-lock --verify-local is an offline coverage check, fit for a pre-commit hook; it does not prove the entries are trustworthy.
  • A partial version ref (@v4) is narrowed to the highest full semver tag when first pinned; keep that unless the user wants otherwise (--no-narrow).
  • A moved ref or unreachable pin is a supply-chain signal. Inspect what the tag or branch now points to and why before running --accept-moved or --relock, and report what moved.
  • Same-repository uses: ./path actions can be migrated to the inherently pinned $/ form with --migrate-local-actions; do it only when asked.
  • Do not onboard a repository without a lockfile unasked. Suggest it in the report, with the number of unpinned actions found.

Without the extension, pin uses: to a full 40-character SHA with the version as a trailing comment (actions/checkout@<sha> # v4.2.2), resolved from the action's own repository with gh api repos/<owner>/<repo>/git/ref/tags/<tag>, dereferencing annotated tags to their commit.

Keep actions updated with Dependabot (package-ecosystem: github-actions). After a bump, rerun gh actions-lock so the lockfile follows.

Write Lean Workflows

  • Trigger precisely: pull_request for checks on PRs, push to the default branch for post-merge work, paths or paths-ignore filters when a job only matters for part of the tree. Do not run the same check on both push and pull_request for the same commit unless the repository relies on it.
  • Add concurrency keyed on the workflow and ref, with cancel-in-progress: true for PR checks, never for deploys or releases.
  • Set timeout-minutes on every job; the default is six hours.
  • Use the setup actions' built-in caching (cache: on setup-node, setup-python, setup-go) or actions/cache keyed on lockfile hashes. Never cache secrets or build outputs that embed them.
  • Use a matrix only for dimensions the project supports; fail-fast: false when each cell's result matters on its own.
  • Extract repeated job sequences into a reusable workflow (workflow_call) or composite action.
  • Keep logic in repository scripts the developer can run locally; the workflow calls them rather than reimplementing them in YAML.

Verify Locally, Then Remotely

  1. Run actionlint on every changed workflow; it also runs ShellCheck on run: scripts when ShellCheck is installed. Run zizmor for security findings when installed. Report which linters were unavailable.
  2. Run gh actions-lock --verify when the repository has a lockfile.
  3. Run the commands the workflow calls locally, with the versions the workflow pins where practical.
  4. Push the change on a branch or PR and watch the real run: gh run watch <run-id>, or gh run list --branch <branch> then gh run view <run-id>. For workflow_dispatch, start it with gh workflow run <file> --ref <branch>. A workflow is not verified until GitHub ran it green.
  5. For triggers that cannot run from a branch (a release, a schedule, pull_request_target), say exactly what was not exercised.

Debug Failing Runs

Read references/debugging.md for the full procedure. Start with gh run view <run-id> --log-failed, find the first actionable error rather than the last red line, reproduce the step's command locally, and decide whether the cause is the change, the base branch, or infrastructure (runner outage, rate limit, expired secret, a moved action ref). Rerun only failed jobs (gh run rerun <run-id> --failed) when the cause is shown to be transient, and never weaken a check to make it pass.

Report

List the workflows and actions changed, the triggers, permissions granted per job and why, actions pinned or the lockfile change, linters run and their results (and which were unavailable), the run URL that proves the change green, and anything that could not be exercised. Name configuration and secrets by name only; never print their values.

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.