agentleFS
jamal-gmljamal-gml/anthropica/skills/ship-github-actions/SKILL.md

ship-github-actions

Skill0 starsChanged 11 days agoMITView on GitHub

Author, harden and debug GitHub Actions workflows (least-privilege token, SHA-pinned actions, OIDC to clouds, script-injection safety, caching, matrices, concurrency, environments, reusable workflows). Use when editing .github/workflows or action.yml, or when a run fails or is slow. Not for platform-neutral pipeline design (use `ship-ci-cd`) or rulesets (use `secure-repo-governance`).

  • Reads credentials

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 2 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Write workflows that are least-privilege, reproducible, fast and safe against untrusted input.

    line 8
  2. Very specific:

    Secrets: only via ${{ secrets.X }} into env: of the step that needs them.

    line 24
  3. Very specific:

    Deploy jobs: use environment: <name> with required reviewers, branch/tag restrictions and wait timers configured in settings.

    line 29
  4. Very specific:

    Fork PRs: no secrets and a read-only token by design.

    line 35
  5. Distinctive:

    Self-hosted runners: never for public repos; use ephemeral runners, isolated per trust level.

    line 36
  6. Very specific:

    Outputs: write via echo "name=value" >> "$GITHUB_OUTPUT" (set-output is removed).

    line 39
  7. Very specific:

    Read references/security.md when a workflow handles untrusted input, uses pull_request_target/workflow_run, publishes artifacts, or is …

    line 44
  8. Very specific:

    Read references/patterns.md when writing reusable workflows, matrices, caches, monorepo filters, release or deploy jobs.

    line 45
  9. Very specific:

    Read references/oidc.md when a job authenticates to a cloud provider or registry.

    line 46
  10. Very specific:

    Read references/debugging.md when a run fails, hangs, is skipped unexpectedly or is slow.

    line 47
  11. Very specific:

    Ask before: pushing workflow changes, running workflow_dispatch against deploy workflows, re-running deploy jobs, creating or changing …

    line 69
  12. Very specific:

    Never weaken permissions:, remove environment protection, delete or rename required checks, or add continue-on-error to hide a failure.

    line 70

≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “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

Write workflows that are least-privilege, reproducible, fast and safe against untrusted input.

Procedure

  1. Inventory: ls .github/workflows, gh workflow list, existing reusable workflows and composite actions (.github/actions/*/action.yml). Extend before adding.
  2. Know the gates: required check names (gh api repos/{owner}/{repo}/rules/branches/<default>), environments (gh api repos/{owner}/{repo}/environments). Renaming a job or workflow can break a required check.
  3. Write or edit following the checklist below.
  4. Pin actions: resolve each tag to a commit SHA: gh api repos/<owner>/<repo>/commits/<tag> -q .sha (works for lightweight and annotated tags). Never guess a SHA. Comment the version: @<sha> # v4.2.2.
  5. Validate: actionlint (includes shellcheck for run:), and zizmor .github/workflows for security if available. Fix every finding or justify it.
  6. Test on a branch via pull_request or workflow_dispatch (gh workflow run <file> --ref <branch>); watch with gh run watch.
  7. Report permissions, secrets and environments by name, and any repo settings that must change.

Authoring checklist

  1. Triggers explicit: push: branches: [main], pull_request, workflow_dispatch, schedule, release. Add paths/paths-ignore for monorepos (but see required-check gotcha in references/patterns.md).
  2. Permissions: top-level permissions: {} or contents: read; grant per job only what it needs (id-token: write for OIDC, pull-requests: write to comment, packages: write to push images, contents: write to tag/release, attestations: write for provenance).
  3. Pinned actions to full 40-char SHAs, including first-party actions/*. Let the dependency bot update them (package-ecosystem: github-actions).
  4. Cloud auth via OIDC, never stored access keys. Read references/oidc.md for AWS, Azure, GCP and registry setups.
  5. Secrets only via ${{ secrets.X }} into env: of the step that needs them; never echo, never pass on the command line. Scope deploy secrets to environments, not the repo.
  6. Untrusted input never in run: directly. Pass through env: and quote: env: TITLE: ${{ github.event.pull_request.title }} then "$TITLE".
  7. Concurrency: CI group: ${{ github.workflow }}-${{ github.ref }}, cancel-in-progress: true. Deploys: group: deploy-<env>, cancel-in-progress: false (never cancel a running deploy).
  8. timeout-minutes on every job (default is 360). Typical: lint 10, tests 20-30, deploy 30.
  9. Caching: setup action's built-in cache (cache: npm|pip|gradle|maven, cache-dependency-path for monorepos) keyed on lockfiles; actions/cache only for other tool caches.
  10. Deploy jobs use environment: <name> with required reviewers, branch/tag restrictions and wait timers configured in settings.
  11. Reuse with reusable workflows (workflow_call) for whole pipelines, composite actions for step sequences.
  12. Shell safety: defaults: run: shell: bash gives -eo pipefail; add set -u in scripts.

Rules

  • Dangerous triggers: pull_request_target and workflow_run run with base-repo secrets and a write token. Never check out or execute PR head code in them. If you must label/comment, use only event metadata via env:.
  • Fork PRs: no secrets and a read-only token by design; never work around it (e.g. switching to pull_request_target).
  • Self-hosted runners: never for public repos; use ephemeral runners, isolated per trust level.
  • GITHUB_TOKEN actions do not trigger new workflow runs (except workflow_dispatch/repository_dispatch). Release bots that need CI on their PRs need an app token, not a PAT tied to a person.
  • Artifacts: retention-days set; never upload .env, credentials or full workspaces. Artifacts of pull_request runs are untrusted when consumed by workflow_run.
  • Outputs: write via echo "name=value" >> "$GITHUB_OUTPUT" (set-output is removed). Mask derived secrets: echo "::add-mask::$VALUE".
  • Expressions: if: ${{ always() }} runs even on cancel; prefer if: ${{ !cancelled() }} for cleanup/report steps. success() is implicit.
  • Matrices: fail-fast: false for test matrices so one failure does not hide others; cap with max-parallel for rate-limited targets.
  • Required checks with path filters or matrices: skipped workflows leave required checks "pending". Use an always-running aggregator job (references/patterns.md).

Read references/security.md when a workflow handles untrusted input, uses pull_request_target/workflow_run, publishes artifacts, or is being audited. Read references/patterns.md when writing reusable workflows, matrices, caches, monorepo filters, release or deploy jobs. Read references/oidc.md when a job authenticates to a cloud provider or registry. Read references/debugging.md when a run fails, hangs, is skipped unexpectedly or is slow.

Typical CI job

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: 20
    steps:
      - uses: actions/checkout@<sha> # vX.Y.Z
        with: { persist-credentials: false }
      - uses: actions/setup-node@<sha> # vX.Y.Z
        with: { node-version-file: .nvmrc, cache: npm }
      - run: npm ci
      - run: npm test

Safety gates

  • Ask before: pushing workflow changes, running workflow_dispatch against deploy workflows, re-running deploy jobs, creating or changing environments, secrets, variables or rulesets.
  • Never weaken permissions:, remove environment protection, delete or rename required checks, or add continue-on-error to hide a failure.
  • Production deploy runs need the user's explicit approval with version and SHA stated.

Output

Workflow: <file>   Triggers: <events + filters>
Jobs: <name> (timeout, runner) ...
Permissions: top <..>; per job <job: scopes>
Actions pinned: <n>/<n> to SHA
Secrets/vars used (names only): <..>   Environments: <..>
OIDC: <provider, role/identity name>
Validation: actionlint <pass/fail>, zizmor <pass/fail/not run>
Settings needed: <required checks, environment rules, OIDC trust>

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.