Skip to content

GitHub Actions (CI/CD automation)

Scope: designing CI/CD and automation workflows on GitHub Actions, including reusable workflows, custom actions and deployments. Workflows run with access to your code, secrets and cloud accounts, so most rules here are about keeping them secure. For general supply-chain rules, see Security.

Entries are sorted by score from 1 to 10 (criteria): 9โ€“10 start here or strongly recommended, 6โ€“8 recommended, 1โ€“5 further reading or conditional.

Adopted references

Key rules

Security

Reuse and deployment

How to enforce

Tools that check the key rules above automatically, in CI, the IDE or a commit hook. "Partly" means the tool covers only some of what the rule asks.

  • 7 GitHub Actions repository settings: the policy "Require actions to be pinned to a full-length commit SHA" blocks unpinned actions (reusable workflows can still use tags), and the restricted "Workflow permissions" setting makes the GITHUB_TOKEN read-only by default. Partly checks GHA-1 and GHA-2.
  • 6 CodeQL queries for GitHub Actions: code scanning that finds code injection, checkout of untrusted code in a privileged context, cache poisoning, workflows without permissions and, in the extended suite, unpinned tags. Checks GHA-3, and partly GHA-1, GHA-2, GHA-4 and GHA-8.
  • 6 zizmor audit rules: a static analyser for workflows. Its default audits include unpinned-uses (since v1.20 it requires SHA pins for all actions), excessive-permissions, template-injection, dangerous-triggers, cache-poisoning and secrets-inherit. self-hosted-runner (auditor persona) and concurrency-limits (pedantic persona) are opt-in. Checks GHA-1, GHA-2, GHA-3, GHA-4 and GHA-10, and partly GHA-6, GHA-8 and GHA-13.
  • 6 OpenSSF Scorecard checks: Token-Permissions looks for read-only top-level permissions, Pinned-Dependencies for actions pinned by hash, and Dangerous-Workflow for untrusted checkouts and script injection. Dependency-Update-Tool only checks that Dependabot or Renovate is enabled. Checks GHA-1 and GHA-2, and partly GHA-3, GHA-4 and GHA-7.
  • 6 actionlint checks: a workflow linter for CI and editors that flags script injection through untrusted inputs, besides syntax, expression and shellcheck errors. Checks GHA-3.
  • 5 Dependabot alerts for actions: alert you when an action your workflows use has a reported vulnerability. Partly checks GHA-7.

Tutorials and further reading