Skip to content

workflow-embedded-program

GitHub workflow run: embeds procedural logic

Why

Procedural programs embedded in run scalars are difficult to exercise locally and move business or validation behavior into GitHub-specific YAML instead of a tested repository-owned entrypoint. Repeating this pattern across component-specific workflows makes the Actions surface noisy. Workflows should select events, permissions, and stable commands—not implement programs.

Fix

Move the control flow or inline interpreter source into a tested repository-owned script, Make target, or package command. Invoke that entrypoint from an existing shared workflow when it already owns the component; add a distinct workflow only for a genuinely distinct trigger or delivery boundary.

Examples

Before — flagged Keep procedural validation out of workflow YAML
.github/workflows/ci.yml
jobs:
test:
steps:
- run: |
for package in api worker; do
make test-package PACKAGE="$package"
done
After — preferred Keep one workflow gating decision inline
.github/workflows/ci.yml
jobs:
test:
steps:
- run: |
if make probe; then
make test
else
echo 'not applicable'
fi

Files

.github/workflows/*.{yaml,yml}