github-actions-rules
MUST NOT / SHOULD NOT rules for GitHub Actions and CI: pinning, permissions, untrusted input, timeouts, polling, required checks, concurrency, runners, and CI log diagnosis. Use when writing or reviewing a workflow, composite action, or CI failure fix.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 11
- Forks
- 1
01 前言 Front Matter
- name
- github-actions-rules
- description
- MUST NOT / SHOULD NOT rules for GitHub Actions and CI: pinning, permissions, untrusted input, timeouts, polling, required checks, concurrency, runners, and CI log diagnosis. Use when writing or reviewing a workflow, composite action, or CI failure fix.
03 SKILL.md 正文
GitHub Actions rules
MUST NOT is a defect. SHOULD NOT needs a stated reason.
Security
- MUST NOT reference actions by tag or branch; pin a full commit SHA with a version comment, and images by digest.
- MUST NOT expand
${{ }}expressions inrunor script bodies; pass them throughenv. - MUST NOT check out or run pull-request code in a privileged
pull_request_targetorworkflow_runworkflow. - MUST NOT act on
workflow_runwithout validating the source workflow, repository, branch, head, and conclusion. - MUST NOT grant write permissions at workflow level; grant least privilege per job.
- MUST NOT persist checkout credentials unless a later step pushes; set
persist-credentials: false. - MUST NOT download and run bytes without a pinned checksum.
- MUST NOT run untrusted code on persistent self-hosted runners.
Reliability
- MUST NOT leave jobs or steps without
timeout-minutes, or set one at or above the platform cap. - MUST NOT fix a slow job by raising its timeout; split it.
- MUST NOT poll remote state (sleep loops, CLI waiters, re-dispatch loops); react to events with
needs,workflow_call,workflow_run, orrepository_dispatch. - MUST NOT path-filter a required check; skipped jobs look missing. Use an always-reporting gate.
- MUST NOT fake required checks with check runs or statuses.
- MUST NOT rely on implicit success for jobs that must run after a failure; check
needs.<job>.result. - MUST NOT cancel in-progress runs on the default branch.
- MUST NOT use a local action before checking out its repository, or workflow-only keys in composite steps.
- MUST NOT assume runner-local state survives on ephemeral runners; use keyed caches.
- MUST NOT publish container ports to fixed host ports on hosted runners.
- MUST NOT hide stderr, quiet output, or add retries that mask a root cause.
- MUST NOT rerun CI to probe a flake; diagnose it.
- SHOULD NOT embed long inline scripts; move them to tested files.
- SHOULD NOT use sparse checkout where checks need the whole tree.
- SHOULD NOT use large or extra-OS runners without a runtime reason.
- SHOULD NOT assert exact action SHAs or versions in tests; assert identity and SHA shape.
- SHOULD NOT parse workflow YAML with regexes; use a YAML parser.
04 同仓库更多 Skills
rollout-rules
MUST NOT / SHOULD NOT rules for shipping changes safely: feature flags, deploy order across services, API and message compatibility, irreversible actions, and string-referenced config. Use when adding a flag, changing an API or message contract, deploying a change that spans services, or touching money-moving or irreversible actions.
observability-rules
MUST NOT / SHOULD NOT rules for logs, metrics, and alerts: static messages and structured fields, personal data, metric cardinality, fields monitors depend on, absence alerts, and context binding. Use when adding or reviewing logging, metrics, or monitors.
integrations-rules
MUST NOT / SHOULD NOT rules for third-party APIs and inbound webhooks: response classification, retries and idempotency, delivery records, payload mapping, timestamps and units, batch failure policy, and signature verification. Use when calling, parsing, or receiving a partner or vendor API.
typescript-rules
MUST NOT / SHOULD NOT rules for TypeScript, JavaScript, and Node.js: async and promises, errors, mutation, aliases and dead paths, static analysis, process lifecycle, HTTP clients, caches like Redis or Valkey, and package boundaries. Use when writing or reviewing TS/JS or Node code.
security-rules
MUST NOT / SHOULD NOT rules for application security and HTTP APIs: secrets, auth and sessions, SSRF, injection, CSRF, CSP, LLM prompts, response exposure, and API shape. Use when writing or reviewing an endpoint, auth code, secret handling, outbound fetches, or LLM calls.
rust-rules
MUST NOT / SHOULD NOT rules for Rust: lints, test layout, file size, parallelism, hot loops, caching, build hygiene, and performance claims. Use when writing or reviewing Rust code or running heavy cargo builds.