用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/leroyguillaume/claude --skill github-actions-conventions命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | github-actions-conventions |
| description | GitHub Actions / CI conventions (canonical quality/build/chart/release |
Apply these when the repo is hosted on GitHub.
.github/ config)--- document marker at the top of workflow or other
.github/ config YAML files. Start directly with the first key.on:, never quoted "on":. (Modern
parsers and actionlint handle the YAML truthiness of on fine.)yaml-conventions.name: — mandatory for uses: steps, and expected on
run: steps too. A nameless action step reads as a bare SHA in the UI.name: set up the Rust toolchain, not name: Set up the Rust toolchain. Proper nouns
inside the name keep their capitals (Rust, GHCR, GitHub).${{ }} expression into a
name:. A conditional/templated label adds noise for no real benefit; pick
one fixed name (name: build the image, not
name: build${{ inputs.push && ' and push' || '' }}).uses: to a full commit SHA, with a trailing comment naming
the tag it corresponds to — and that comment must track the latest
release tag of the action:
- uses: actions/checkout@<40-char-sha> # v4.2.2
A tag is mutable; a SHA is not. Resolve the SHA of the latest tag with
git ls-remote --tags https://github.com/<owner>/<repo> '<tag>^{}'..github/dependabot.yaml with the github-actions ecosystem so the
pinned SHAs (and their tag comments) are bumped automatically.@v4, @main, @stable) in a
committed workflow.Create exactly these workflows, conditioned on what the repo contains. Give
each least-privilege permissions: (default contents: read; widen only in
the job that needs it).
quality — always. Runs pre-commit run --all-files and the test
suite, on push to the default branch and on every pull request. Because the
language: system hooks shell out to real binaries, the job must install
every tool the hooks need (toolchain + helm, helm-docs, hadolint,
actionlint, …) before running pre-commit. This is the single quality
gate — do not scatter fmt/lint/test across ad-hoc workflows.build — when a Dockerfile exists. Builds the image, and pushes
only when explicitly asked: triggered by workflow_dispatch (a push
boolean input) or invoked via workflow_call with push: true. On a plain
push/PR it builds without pushing (validation only). Expose push and
version as workflow_call/workflow_dispatch inputs. Multi-arch Rust:
always a static matrix over both architectures — amd64 on
ubuntu-24.04 and arm64 on ubuntu-24.04-arm — each on its own native
runner. Never QEMU-emulate a Rust build, and never drop an architecture
from the matrix on PRs (validate both). When pushing, each arch job
build/pushes by digest and a final manifest job assembles the
multi-arch manifest (that job runs only when pushing). Derive image
tags and labels with docker/metadata-action — labels on each per-arch
build, tags in the manifest job (consumed from DOCKER_METADATA_OUTPUT_JSON
by docker buildx imagetools create). Never hand-roll tag strings.chart — when a Helm chart exists. Publishes the chart as an OCI
artifact to GHCR (helm push → oci://ghcr.io/<owner>/charts). The chart
has its own release lifecycle, decoupled from the app: trigger it on a
dedicated tag namespace chart-* (plus for manual
publishes), never on PR (PR validation is inside ).
Derive the chart version from the tag and pass it to
; leave to (the app
image the chart targets evolves independently of the chart's own version).
The workflow does publish the chart.push/pull_request must carry a paths: (or
paths-ignore:) filter so it only runs when files that actually affect it
change. A multi-arch image build must not fire on a docs-only or
chart-only change; scope it to its real inputs (e.g. src/**, Cargo.toml,
Cargo.lock, Dockerfile, .dockerignore, and the workflow file itself).quality workflow (pre-commit + tests) is never
path-filtered. It is the universal gate and must run on every push and pull
request, whatever changed.chart on chart-*, release on v*) and
workflow_dispatch / workflow_call take no paths — path filters do
not apply to those events.Every workflow carries a top-level concurrency: block keyed on the ref, so
two runs of the same workflow never overlap on the same branch or tag:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: true, always — no exceptions, publishing workflows
included. A run for a superseded commit is dead weight; kill it and free the
runner. Do not reach for false on release/chart to protect a push
mid-flight: registries are the place to make a partial publish safe (immutable
tags, digest-addressed pushes, a re-run of the same tag), not the concurrency
block. Never write cancel-in-progress: false, and never make it conditional
on the event.workflow_call) workflow, hardcode the workflow name in the
group instead of ${{ github.workflow }}. In a called run that expression
resolves to the caller, so build would land in the same group as
release and cancel the very job waiting on it. Write
group: build-${{ github.ref }}.github.ref, not github.head_ref — the latter is empty outside
pull_request events and would collapse every push into one shared group.Cache what is expensive to recompute, not what is cheap to re-download. The crates.io / registry download is fast; restoring a large dependency cache can be slower than a clean fetch, and a stale cache is worse than none.
type=gha,scope=<arch>) so the two arch runners never clobber each other;
and the compiled-dependency cache (cargo-chef in the Dockerfile,
Swatinem/rust-cache for non-Docker Rust jobs) — these cache CPU work,
not downloads.Never:
---, and never quote "on".workflow_dispatch or the release orchestration.pre-commit + tests live in the single
quality workflow.concurrency: group, and never set
cancel-in-progress to anything but true — not false, not an expression,
not even on release/chart.workflow_dispatchhelm lintpre-commitchart-X.Y.Zhelm package --version <v>appVersionChart.yamlreleaserelease — always (the app-release orchestrator). Triggered by pushing a
git tag vX.Y.Z. It: (1) derives the version from the tag (strip the leading
v for a SemVer image tag); (2) calls build with push: true and the
version; (3) creates a GitHub Release with auto-generated notes
(gh release create "$TAG" --generate-notes). The version flows from the tag
into the image tag at build time — never edit a version/appVersion
field in a file to cut a release. Release the chart separately via its
chart-* tag — the app and the chart version independently..github/release.yaml — always, when a release workflow exists. The
GitHub auto-generated-notes config (categorise PRs by label, exclude noise).
gh release create --generate-notes reads it.