github-actions-conventions
Skill7 starsChanged 2 days agoMITView on GitHub
GitHub Actions mechanics: workflows, pinned actions, SARIF, release notes, Releases, Pages. TRIGGER when: editing anything under `.github/workflows/` or `.github/actions/`, `.github/release.yaml`, or an `action.yaml`/`.yml`; setting up CI on GitHub; user asks about Actions, runners, SARIF, script injection or `pull_request_target`, GitHub Releases, Pages, the OpenSSF Scorecard workflow or the coverage report. SKIP when: the repo is not on GitHub (`gitlab-ci-conventions`). Load `ci-conventions` alongside.
- Pipes a download into a shell
- Reads credentials
- Commits and pushes
1 other project uses a version of this.
Adopted by
Most recently taken up by
- leroyguillaume/claudeword for word, first seen Nov 29, 2026
Other versions1 project uses a version of this.
Word for word · 1
- leroyguillaume/claude★ 7100% same
Edited · 0
None found.
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository54 other files it gives its agents.
- adr-conventionsSkill
- api-conventionsSkill
- architecture-conventionsSkill
- argocd-conventionsSkill
- ci-conventionsSkill
- config-conventionsSkill
- contributing-conventionsSkill
- councilSkill
- cryptography-conventionsSkill
- dependency-update-conventionsSkill
- diagram-conventionsSkill
- docker-conventionsSkill
- documentation-conventionsSkill
- frontend-conventionsSkill
- github-issue-conventionsSkill
- github-pr-conventionsSkill
- github-repo-settingsSkill
- gitlab-ci-conventionsSkill
- helm-conventionsSkill
- herdr-core-delegationSkill
- herdr-delegationSkill
- herdr-tui-delegationSkill
- kopf-conventionsSkill
- kubernetes-operator-conventionsSkill
- logging-conventionsSkill
- logo-conventionsSkill
- mise-conventionsSkill
- ollama-conventionsSkill
- openssf-conventionsSkill
- pr-conventionsSkill
- pre-commit-conventionsSkill
- project-metadata-conventionsSkill
- python-async-conventionsSkill
- python-conventionsSkill
- readme-conventionsSkill
- release-script-conventionsSkill
- release-supply-chain-conventionsSkill
- renovate-ci-conventionsSkill
- rest-conventionsSkill
- rust-build-conventionsSkill
- rust-conventionsSkill
- rust-http-conventionsSkill
- security-policy-conventionsSkill
- signal-handling-conventionsSkill
- sql-conventionsSkill
- starlight-conventionsSkill
- systemd-conventionsSkill
- system-user-conventionsSkill
- task-conventionsSkill
- terraform-conventionsSkill
- topic-splittingSkill
- ui-copy-conventionsSkill
- web-layout-conventionsSkill
- yaml-conventionsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
15 rules. About 0 are common, 4 are distinctive, and 11 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
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
- Very specific: line 27
Write the trigger key as bare on:, never quoted "on":.
- Very specific: line 37
Keep step names static. Never interpolate ${{ }} into a name:.
- Very specific: line 50
Never use a bare branch or tag ref (@v4, @main, @stable).
- Very specific: line 116
Only the jobs of quality and, when it exists, security (never filtered) are required, in the default branch's ruleset …
- Distinctive: line 247
No mise or npm cache: both are downloads.
- Very specific: line 251
Always present when a release workflow exists.
- Distinctive: line 404
Every workflow has a top-level block:
- Very specific: line 450
Never start a workflow file with ---, and never quote "on".
- Distinctive: line 451
Never use a bare branch/tag action ref.
- Very specific: line 452
Never put ${{ }} in a run: script, and never trigger on pull_request_target.
- Very specific: line 454
Never make a paths-filtered workflow, or coverage, a required check.
- Very specific: line 455
Never share one unscoped type=gha cache across architectures.
- Very specific: line 456
Never use ${{ github.workflow }} in the concurrency group of a reusable workflow.
- Very specific: line 458
Never let two SARIF uploads share a category.
- Distinctive: line 459
Never deploy Pages from a tag run.
≈ “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 conventions
How the pipelines from ci-conventions are written on GitHub. One workflow
file per canonical pipeline the repo needs: .github/workflows/quality.yaml,
coverage.yaml, build.yaml, security.yaml, chart.yaml, release.yaml,
docs.yaml.
ci-conventions says which ones a repo has; a repo with no lockfile and no
published image has no security.yaml. A public repository also has
scorecard.yaml (below).
YAML style
Write the trigger key as bare on:, never quoted "on":. Everything else
is yaml-conventions.
Step naming
- Every step has a
name:. It is mandatory foruses:steps and expected onrun:steps. A nameless action step reads as a bare SHA in the UI. - Step names start with a lowercase letter:
name: set up the Rust toolchain. Proper nouns keep their capitals (Rust,GHCR,GitHub). - Keep step names static. Never interpolate
${{ }}into aname:.
Pin actions by SHA
- Pin every
uses:to a full commit SHA, with a trailing comment naming the latest release tag it corresponds to:
Resolve it with- uses: actions/checkout@<40-char-sha> # vX.Y.Zgit ls-remote --tags https://github.com/<owner>/<repo> '<tag>^{}'. - Renovate's
github-actionsmanager bumps the SHAs and their tag comments together (dependency-update-conventions). - Never use a bare branch or tag ref (
@v4,@main,@stable). - A same-repository action or reusable workflow is
uses: $/<path>, never./<path>:$/resolves to the running commit, needs no checkout, and counts as pinned. It is github.com only, not GitHub Enterprise Server.
Permissions
Top-level permissions: contents: read. Widen only in the job that needs
it: packages: write to push to GHCR, security-events: write for the SARIF
upload, contents: write for gh release create, packages: read to pull a
private image on the scheduled scan, id-token: write to attest a release
(with attestations: write) or to publish through a registry's trusted
publishing (release-supply-chain-conventions).
A called workflow can only keep or narrow the GITHUB_TOKEN scope of the job
that calls it, never widen it. The release job that runs uses:
$/.github/workflows/build.yaml therefore grants packages: write itself;
without it the push is denied however build.yaml declares its own
permissions.
Untrusted input
A workflow that runs code or text an outsider controls hands them the repository's token and secrets (Scorecard's Dangerous-Workflow check).
- No
${{ }}inside arun:script, nor inactions/github-script'sscript:. The expression is pasted into the script before the shell parses it, so a pull request title or branch name holding"; curl … | shruns as code. Pass the value through the step'senv:and quote the variable:- name: print the pull request title env: TITLE: ${{ github.event.pull_request.title }} run: printf '%s\n' "$TITLE" - No
pull_request_targettrigger, and noworkflow_runworkflow that checks out or runs the triggering pull request's code. Both run a fork's code with the base repository's secrets and a write token.pull_requestgives a fork read-only access and no secrets, which is all CI needs. persist-credentials: falseon everyactions/checkout. Otherwise the token stays in.git/configfor every later step, and in any artifact that uploads the workspace.ghreadsGH_TOKENfrom the step'senv, so no job needs git's stored credentials.
Triggers per workflow
| Workflow | Triggers |
quality | push to the default branch, pull_request, no paths |
coverage | push to the default branch, pull_request, no paths |
build | push/pull_request with paths, workflow_dispatch and workflow_call with push and version inputs |
security | push to the default branch, pull_request, schedule, workflow_dispatch, no paths |
chart | push of tags chart-*, workflow_dispatch |
release | push of tags v* |
docs | push to the default branch and pull_request with paths, workflow_dispatch |
scorecard | push to the default branch, weekly schedule, branch_protection_rule |
Path filters do not apply to tag, schedule, workflow_dispatch or
workflow_call events, so don't write them there.
chart runs the same version drift guard as release before it packages
(release-script-conventions).
A paths-filtered workflow must never be a required status check. When
the filter skips it, the check never reports and the PR waits on it forever.
Only the jobs of quality and, when it exists, security (never filtered)
are required, in the default branch's ruleset (github-repo-settings).
coverage is unfiltered but never required: it reports, it does not gate
(ci-conventions).
coverage
One job on ubuntu-24.04, contents: read, so it runs the same on a fork's
pull request. After the checkout, jdx/mise-action and the language's build
cache (rust-cache with its save-if, below):
- name: measure the coverage
run: task coverage
- name: write the summary to the job summary
run: |
{
echo '## Test coverage'
echo '```text'
task --silent coverage:summary
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
- name: upload the HTML report
uses: actions/upload-artifact@<40-char-sha> # vX.Y.Z
with:
name: coverage-html
path: <the language skill's HTML report directory>
if-no-files-found: error- The summary goes in a
textfence: the tools print aligned columns, which Markdown would reflow. if-no-files-found: error: a report path that drifted from the tool's output otherwise uploads nothing, silently.
build and release
- Multi-arch: a static
matrixwithamd64onubuntu-24.04andarm64onubuntu-24.04-arm. - Tags and labels come from
docker/metadata-action: labels on each per-arch build, tags in themanifestjob, consumed fromDOCKER_METADATA_OUTPUT_JSONbydocker buildx imagetools create. - Scan before push:
docker/build-push-actionwithload: true, thentrivy imageon the loaded image, then the same build again with a push by digest. That second build is a full cache hit, so the pushed layers are the ones that were scanned. - Layer cache:
type=gha,scope=<target>-<arch>. An unscopedtype=ghacache is shared, so the two arch jobs overwrite each other.cache-fromunless the run pushes, since a publishing run restores no cache;cache-tofrom the default branch only, withmode=max, sincemode=mindrops the intermediate stages and with them thecargo chef cooklayer. The push build still hits the scan build's layers, which the job's builder keeps:cache-from: >- ${{ !inputs.push && format('type=gha,scope={0}-{1}', matrix.target, matrix.platform.arch) || '' }} cache-to: >- ${{ github.ref == 'refs/heads/main' && format('type=gha,mode=max,scope={0}-{1}', matrix.target, matrix.platform.arch) || '' }} releasecallsbuildthroughworkflow_callwithpush: true, thengh release create "$TAG" --generate-notesgated on the tag containing no-. For a stable tag, pass--notes-start-tagwith the previous stable tag.- On a public repository,
manifestattests the image it tagged, andreleaseattests and uploads its files, SBOM and attestation bundle (release-supply-chain-conventions).
Caches
What to cache and who saves it is ci-conventions. On GitHub:
- A run restores its own ref's caches and the default branch's, nothing
else. A PR can't read another PR's, and a tag run reads only
main's. - A publishing run restores no build cache (
ci-conventions).releaseandchartset a top-levelcache-mode: none, which GitHub enforces on every job and on the workflows they call. A manualbuildwithpushescapes that cap, so it drops itscache-fromitself (above). Swatinem/rust-cachewithsave-if: ${{ github.ref == 'refs/heads/main' }}; without it every PR saves its owntarget/, hundreds of MB each.- The repository has a 10 GB quota with least-recently-used eviction, and evicts any entry unused for 7 days (the retention setting). Changing either is a repository setting, so it waits for the user's yes.
- Diagnose with
gh api repos/{owner}/{repo}/actions/cache/usage(total against the quota),gh cache list --ref <ref>(what a ref saved), and the run logs: rust-cache'sfull match: true|false, buildx'sCACHEDsteps andexporting cachetime.
docs and GitHub Pages
What the pipeline does is in starlight-conventions. On GitHub:
- Pages source is "GitHub Actions": checking and switching it on is
github-repo-settings' job. A custom domain is set in the repository's Pages settings, and the site'ssite/basefollow it. NoCNAMEfile is needed with an Actions deployment. - Two jobs.
buildchecks out withfetch-depth: 0(the release tags), runsjdx/mise-actionfor Node.js (mise-conventions),npm ci, and the versioned build, thenactions/upload-pages-artifactwithpath: docs/diston non-PR runs of the default branch only.deploy(needs: build, same condition) runsactions/deploy-pagesinenvironment: github-pageswithurl: ${{ steps.deploy.outputs.page_url }}. permissions: pages: writeandid-token: writeondeployalone; the workflow stayscontents: read.- The
github-pagesenvironment deploys from the default branch only, so a tag run cannot deploy. After a stable release,releasedispatches the docs on the default branch, in a job thatneeds:the GitHub Release job (skipped for an rc, so the docs are too):
Adocs: name: docs needs: - github-release permissions: actions: write runs-on: ubuntu-24.04 steps: - name: rebuild the documentation site env: GH_TOKEN: ${{ github.token }} DEFAULT_BRANCH: ${{ github.event.repository.default_branch }} run: gh workflow run docs.yaml --repo "$GITHUB_REPOSITORY" --ref "$DEFAULT_BRANCH"workflow_dispatchsent withGITHUB_TOKENdoes start a run, unlike most events that token triggers. docsispaths-filtered, so it is never a required check. The site's tests run inquality, in their own job.- No mise or npm cache: both are downloads.
.github/release.yaml
Always present when a release workflow exists. --generate-notes reads it.
GitHub files a PR under the first category whose labels match, so
Breaking changes comes first. A breaking PR also carries its usual
feature/fix label, and only the order keeps it out of that section.
changelog:
exclude:
labels:
- ignore-for-release
categories:
- title: Breaking changes
labels:
- breaking
- title: Security
labels:
- security
- title: Deprecations
labels:
- deprecation
- title: Features
labels:
- feature
- title: Performance
labels:
- performance
- title: Fixes
labels:
- fix
- title: Documentation
labels:
- documentation
- title: Dependencies
labels:
- dependencies
- title: Maintenance
labels:
- chore
- title: Other changes
labels:
- "*"Creating this file or changing its labels includes syncing the repo's labels
to it (github-repo-settings), in the same change: gh pr create --label
fails on a label the repo lacks.
Trivy on GitHub
aquasecurity/trivy-action, SHA-pinned.cache: truefor the DB.- The gate step:
exit-code: 1,severity: HIGH,CRITICAL,ignore-unfixed: true. - The reporting step:
format: sarif, noexit-code, thengithub/codeql-action/upload-sarifwithif: always()so a failed gate doesn't swallow the report. A pull request from a fork gets a read-onlyGITHUB_TOKEN, so the upload fails there; guard it to same-repository runs:if: >- always() && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) - Each SARIF upload has its own
category(trivy-fs,trivy-image). Code scanning keys alerts on it. Two uploads sharing one replace each other, and the first scan's alerts get closed as "fixed". - The schedule:
Scheduled workflows only run from the default branch, and GitHub disables them after 60 days without activity on a public repo, without telling anyone. A dormant repo that still ships an image needs it re-enabled from the Actions tab.on: schedule: - cron: "23 4 * * *" workflow_dispatch:
scorecard
A public repository runs OpenSSF Scorecard, which grades its supply-chain
practices (pinned actions, token permissions, branch protection, a security
policy, signed releases, …) and publishes the result. It is free on a public
repository only; a private one has no scorecard.yaml.
name: scorecard
on:
push:
branches:
- main
schedule:
- cron: "37 5 * * 1"
branch_protection_rule:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
analysis:
runs-on: ubuntu-24.04
permissions:
contents: read
security-events: write
id-token: write
steps:
- name: check out the repository
uses: actions/checkout@<40-char-sha> # vX.Y.Z
with:
persist-credentials: false
- name: run the Scorecard analysis
uses: ossf/scorecard-action@<40-char-sha> # vX.Y.Z
with:
results_file: results.sarif
results_format: sarif
publish_results: true
- name: upload the results to code scanning
if: always()
uses: github/codeql-action/upload-sarif@<40-char-sha> # vX.Y.Z
with:
sarif_file: results.sarif
category: scorecardbranch_protection_rulere-grades as soon as a rule changes, and the weekly schedule keeps the activity-based checks current on a quiet repo. The 60-day rule for scheduled workflows (Trivy, above) applies.publish_results: truesends the signed result to the Scorecard API, which is what the badge reads. The API then rejects a run whose workflow breaks its rules, so this file never gains: a top-levelenvordefaults, a write permission at workflow level,id-token: writeon another job, and, in theanalysisjob, anenv, acontainer,services, a runner other than a GitHub-hosted Ubuntu one, arun:step, or an action outsideactions/checkout,actions/upload-artifact,github/codeql-action/upload-sarif,ossf/scorecard-actionandstep-security/harden-runner.- It never runs on a pull request, so it is never a required check.
- The README carries its badge, on the badge line (
readme-conventions):[](https://scorecard.dev/viewer/?uri=github.com/<owner>/<repo>) - A finding is fixed in the repository — pin the action, narrow the token,
add the
SECURITY.md— never dismissed in code scanning to lift the score.
Concurrency
Every workflow has a top-level block:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: truecancel-in-progress: true, literally. Neverfalse, never an expression.- In a
workflow_callworkflow, hardcode the name:group: build-${{ github.ref }}. In a called rungithub.workflowresolves to the caller, sobuildwould sharerelease's group and cancel the very job waiting on it. - Key on
github.ref, notgithub.head_ref. The latter is empty outsidepull_request, and every push would collapse into one group.
Lint
The zizmor pre-commit hook, always, on a repo with workflows. It checks them
against GitHub's schema and the rules above: untrusted input,
persist-credentials, permissions, pinning, cache poisoning.
- repo: https://github.com/zizmorcore/zizmor-pre-commit
rev: <latest tag SHA> # frozen: <latest tag>
hooks:
- id: zizmor
args:
- --offline
- --strict-collection
- --no-progress--offline: withGH_TOKENorGITHUB_TOKENset, zizmor runs its online audits, and fails without network or on a revoked token. Offline, it needs neither.argsreplaces the hook's own--no-progress, hence repeating it.--strict-collection: without it, a workflow that breaks the schema is skipped with a warning and the hook passes.- No
actionlintbeside it: it rejects$/andcache-mode. - It also audits
.pre-commit-config.yamland.github/dependabot.yaml. - A finding is fixed, never silenced with a
# zizmor: ignore[…]comment or azizmor.ymlrule on the agent's own authority (ci-conventions).
Never
- Never start a workflow file with
---, and never quote"on". - Never use a bare branch/tag action ref.
- Never put
${{ }}in arun:script, and never trigger onpull_request_target. - Never make a
paths-filtered workflow, orcoverage, a required check. - Never share one unscoped
type=ghacache across architectures. - Never use
${{ github.workflow }}in the concurrency group of a reusable workflow. - Never let two SARIF uploads share a
category. - Never deploy Pages from a tag run; dispatch the docs on the default branch.
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.

