run: step, a Markdown copy-paste block, or a heredoc smuggling a Bash loop
is the worst of every world. No test or lint covers it, and nobody can find it. The rules below apply
to every repo across the org.
Iron law
Scripts must live in.sh, .py, .ts, .js, .rb, or .pl files under one of:
scripts/.github/scripts/.claude/hooks/tests/plugins/<name>/hooks/
Banned in non-script files
- YAML
run:with control flow (if,for,while,case) or 4+ lines - Multi-line Bash control flow in a single command
- Heredocs carrying logic (
bash <<EOF,python <<EOF, generated commit bodies) - Inline interpreters:
python -c,node -e,perl -e,ruby -e, multi-linebash -c - Markdown copy-paste-execute blocks with logic
Allowed
- Single-line pipelines (
|,&&,xargs) - 1–3 line YAML
run:without control flow - One-line heredocs feeding static prose
Four-tier search
Before writing any new script, search every tier. Log one line per tier (<tier>: <tool> — found / not-found, reason). Empty rows reject the search.
- Native features and builtins (
jq,gh,git,curl, and features of software already in use) - Ecosystem primitives (Ansible modules, OpenTofu resources, marketplace Actions, pre-commit)
- Maintained third-party tools (Homebrew, apt, pip, npm, cargo)
- Maintained projects to fork (GitHub projects, official plugins,
awesome-*lists)
Worked examples
Pull request behavior follows PR conventions.Multi-line Bash control flow
Wrong:Heredoc smuggling logic
Wrong:git commit -m "$(cat <<'EOF' ... $(if ...) ... EOF)"
Right: git commit -m "feat: standard release" (generate the body in a script file if it needs computation)
Inline interpreters
Wrong:python -c "import json; print(json.load(open('x.json'))['key'])"
Right: jq -r .key x.json
What this connects to
Commit conventions
How commit and PR shapes interact with release-please.
CI/CD policy
Marketplace actions and reusable workflows that replace most ad-hoc scripts.
OpenTofu check placement
The canonical example of the four-tier search applied to a real domain.