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
In this repository33 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- global/CLAUDE.mdCLAUDE.md
- build-backendSkill
- build-commitsSkill
- build-containersSkill
- build-databaseSkill
- build-design-systemSkill
- build-frontendSkill
- build-iacSkill
- build-project-setupSkill
- core-documentationSkill
- core-prompt-engineeringSkill
- core-token-efficiencySkill
- create-marketing-copySkill
- create-seo-contentSkill
- operate-incidentSkill
- operate-observabilitySkill
- plan-architectureSkill
- plan-campaignSkill
- plan-codebase-analysisSkill
- plan-test-strategySkill
- plan-threat-modelSkill
- review-pull-requestSkill
- review-seoSkill
- review-ui-uxSkill
- secure-code-reviewSkill
- secure-repo-governanceSkill
- secure-supply-chainSkill
- ship-ci-cdSkill
- ship-readinessSkill
- ship-releaseSkill
- test-performanceSkill
- test-validationSkill
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
- Distinctive: line 8
Write workflows that are least-privilege, reproducible, fast and safe against untrusted input.
- Very specific: line 24
Secrets: only via ${{ secrets.X }} into env: of the step that needs them.
- Very specific: line 29
Deploy jobs: use environment: <name> with required reviewers, branch/tag restrictions and wait timers configured in settings.
- Very specific: line 35
Fork PRs: no secrets and a read-only token by design.
- Distinctive: line 36
Self-hosted runners: never for public repos; use ephemeral runners, isolated per trust level.
- Very specific: line 39
Outputs: write via echo "name=value" >> "$GITHUB_OUTPUT" (set-output is removed).
- Very specific: line 44
Read references/security.md when a workflow handles untrusted input, uses pull_request_target/workflow_run, publishes artifacts, or is …
- Very specific: line 45
Read references/patterns.md when writing reusable workflows, matrices, caches, monorepo filters, release or deploy jobs.
- Very specific: line 46
Read references/oidc.md when a job authenticates to a cloud provider or registry.
- Very specific: line 47
Read references/debugging.md when a run fails, hangs, is skipped unexpectedly or is slow.
- Very specific: line 69
Ask before: pushing workflow changes, running workflow_dispatch against deploy workflows, re-running deploy jobs, creating or changing …
- Very specific: line 70
Never weaken permissions:, remove environment protection, delete or rename required checks, or add continue-on-error to hide a failure.
≈ “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.
Files
GitHub Actions
Write workflows that are least-privilege, reproducible, fast and safe against untrusted input.
Procedure
- Inventory:
ls .github/workflows,gh workflow list, existing reusable workflows and composite actions (.github/actions/*/action.yml). Extend before adding. - 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. - Write or edit following the checklist below.
- 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. - Validate:
actionlint(includes shellcheck forrun:), andzizmor .github/workflowsfor security if available. Fix every finding or justify it. - Test on a branch via
pull_requestorworkflow_dispatch(gh workflow run <file> --ref <branch>); watch withgh run watch. - Report permissions, secrets and environments by name, and any repo settings that must change.
Authoring checklist
- Triggers explicit:
push: branches: [main],pull_request,workflow_dispatch,schedule,release. Addpaths/paths-ignorefor monorepos (but see required-check gotcha inreferences/patterns.md). - Permissions: top-level
permissions: {}orcontents: read; grant per job only what it needs (id-token: writefor OIDC,pull-requests: writeto comment,packages: writeto push images,contents: writeto tag/release,attestations: writefor provenance). - Pinned actions to full 40-char SHAs, including first-party
actions/*. Let the dependency bot update them (package-ecosystem: github-actions). - Cloud auth via OIDC, never stored access keys. Read
references/oidc.mdfor AWS, Azure, GCP and registry setups. - Secrets only via
${{ secrets.X }}intoenv:of the step that needs them; never echo, never pass on the command line. Scope deploy secrets to environments, not the repo. - Untrusted input never in
run:directly. Pass throughenv:and quote:env: TITLE: ${{ github.event.pull_request.title }}then"$TITLE". - Concurrency: CI
group: ${{ github.workflow }}-${{ github.ref }},cancel-in-progress: true. Deploys:group: deploy-<env>,cancel-in-progress: false(never cancel a running deploy). timeout-minuteson every job (default is 360). Typical: lint 10, tests 20-30, deploy 30.- Caching: setup action's built-in cache (
cache: npm|pip|gradle|maven,cache-dependency-pathfor monorepos) keyed on lockfiles;actions/cacheonly for other tool caches. - Deploy jobs use
environment: <name>with required reviewers, branch/tag restrictions and wait timers configured in settings. - Reuse with reusable workflows (
workflow_call) for whole pipelines, composite actions for step sequences. - Shell safety:
defaults: run: shell: bashgives-eo pipefail; addset -uin scripts.
Rules
- Dangerous triggers:
pull_request_targetandworkflow_runrun 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 viaenv:. - 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_TOKENactions do not trigger new workflow runs (exceptworkflow_dispatch/repository_dispatch). Release bots that need CI on their PRs need an app token, not a PAT tied to a person.- Artifacts:
retention-daysset; never upload.env, credentials or full workspaces. Artifacts ofpull_requestruns are untrusted when consumed byworkflow_run. - Outputs: write via
echo "name=value" >> "$GITHUB_OUTPUT"(set-outputis removed). Mask derived secrets:echo "::add-mask::$VALUE". - Expressions:
if: ${{ always() }}runs even on cancel; preferif: ${{ !cancelled() }}for cleanup/report steps.success()is implicit. - Matrices:
fail-fast: falsefor test matrices so one failure does not hide others; cap withmax-parallelfor 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 testSafety gates
- Ask before: pushing workflow changes, running
workflow_dispatchagainst 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 addcontinue-on-errorto 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>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.

