agentleFS
SnoozleStudioSnoozleStudio/opencode-wp-settings/skills/wp-github-actions-standards/SKILL.md

wp-github-actions-standards

Skill4 starsChanged 3 days agoMITView on GitHub

WordPress GitHub Actions Workflow Standards reference — actionlint and zizmor, template injection via env vars, dangerous triggers, least-privilege permissions, persist-credentials false, unpinned uses with SHA pins, cache poisoning. Use when writing or reviewing CI workflows in .github/workflows, or when asked about GitHub Actions security for WordPress projects.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Write and review .github/workflows/*.yml that pass actionlint (correctness) and zizmor (security), following WordPress's two-linter …

    line 14
  2. Very specific:

    Never interpolate ${{ github.event.* }} into a run: block or github-script body.

    line 40
  3. Distinctive:

    Always add a version comment matching a REAL ref (check git ls-remote --tags — zizmor fails on comments pointing at nonexistent refs).

    line 85
  4. Distinctive:

    Never pin an action to a branch or moving tag

    line 104
  5. Very specific:

    Never interpolate untrusted expressions into run: blocks

    line 105
  6. Very specific:

    Every workflow has permissions: {}.

    line 106
  7. Distinctive:

    Never bypass actionlint/zizmor findings without a documented dismissal

    line 108

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

WordPress GitHub Actions Workflow Standards

Distilled from the official WordPress GitHub Actions Workflow Standards (developer.wordpress.org, Apr 2026). Workflows run in a highly privileged supply chain environment — a weakness in a workflow file can have severe consequences.

Goal

Write and review .github/workflows/*.yml that pass actionlint (correctness) and zizmor (security), following WordPress's two-linter discipline.

When to use

  • Writing or reviewing CI workflows in a theme/plugin repo
  • Answering "is this workflow safe / standard-compliant"
  • Adding actions, triggers, or permissions to an existing workflow

The standard

The two linters

  • actionlint — static checker for correctness: syntax validation, expression type-checking, action/reusable-workflow input validation, shell script syntax, common mistakes. Run: actionlint from the repo root
  • zizmor — security linter: template injection, excessive permissions, dangerous triggers, unpinned dependencies, credential persistence. Run: zizmor . (note the trailing period); GH_TOKEN=$(gh auth token) zizmor . for the online audits (known-vulnerable actions, impostor commits)
  • A failing actionlint check must be fixed before the change can land

Security issues to address

Template injection — GitHub expressions are interpreted BEFORE the script runs; attacker-controlled values can inject shell commands even inside quotes. Never interpolate ${{ github.event.* }} into a run: block or github-script body. Pass through env vars — treated as data, not code:

- name: Print title
  run: echo "Title: ${PR_TITLE}"
  env:
    PR_TITLE: ${{ github.event.pull_request.title }}

Dangerous triggers — pull_request_target and workflow_run run in the base repo context with secrets access. Avoid unless genuinely needed (commenting on PRs, managing labels); NEVER check out the PR head ref and run code from it in a pull_request_target workflow; document the justification inline when used.

Excessive permissions — least privilege. Every workflow gets a top-level permissions: {} granting nothing, with individual jobs declaring only what they need. Omitting permissions entirely is not sufficient:

permissions: {}

jobs:
  lint:
    runs-on: ubuntu-latest
    permissions:
      contents: read

Persisted credentials — actions/checkout persists credentials by default; if the checkout dir is uploaded as an artifact the credentials leak. Always set persist-credentials: false unless the job must push, then set it explicitly with a comment.

Environment manipulation — writing user-controlled values to $GITHUB_ENV or $GITHUB_PATH allows injecting env vars or PATH entries. Only write values fully controlled by the workflow; validate user input before writing.

Unpinned uses — every third-party action pinned to a full commit SHA, never a tag or branch (tags can move):

- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

Always add a version comment matching a REAL ref (check git ls-remote --tags — zizmor fails on comments pointing at nonexistent refs). Update both the SHA and the comment when bumping.

Cache poisoning — avoid actions/cache/built-in caching in workflows that build and publish release artifacts; if unavoidable, scope the key tightly and verify cache contents.

Repo-local practice

  • This repo's ci.yml runs actionlint 1.7.12 + zizmor 1.30.1 in a workflows job on every push/PR — pinned versions via binary download and pip
  • Scaffolded theme/plugin templates ship a verification-chain workflow (.github/workflows/ci.yml) compliant with this standard
  • Verified pins: checkout v4.4.0 11d5960..., setup-bun v2.2.0 0c5077e..., setup-php 2.37.2 f3e473d... (unprefixed tag — no v in the comment)

Rules

  • Never pin an action to a branch or moving tag
  • Never interpolate untrusted expressions into run: blocks
  • Every workflow has permissions: {}; every checkout has persist-credentials: false unless pushing
  • Never bypass actionlint/zizmor findings without a documented dismissal

Output contract

  • Written workflows: actionlint-clean and zizmor-clean (verified locally or in CI)
  • Review findings: file:line + audit type + fix

References

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.