The code-quality.yml workflow is the PR gate for this repository. It runs automatically on every pull request targeting main.
The workflow runs a single quality job with conditional steps:
- Detect changes — uses
tj-actions/changed-filesto determine which files changed - Lint Markdown — runs
markdownlint-cli2if any.mdfiles or the workflow file itself changed - Install bats — installs the test runner if any action or test files changed
- Per-action tests — runs
bats tests/unit/{action-name}/for each action whose files changed
Only the steps relevant to the PR's changes are executed, keeping runner time minimal.
| Step | Triggers when... |
|---|---|
| Lint Markdown | Any **/*.md file or code-quality.yml itself changed |
| bats tests | Files changed in .github/actions/{action-name}/ or tests/unit/{action-name}/ |
The workflow maintains an explicit list of actions that have bats test suites:
actions_with_tests=(
"promote-ecr-image"
"test-python"
"update-aws-ecs"
"update-aws-lambda"
)When adding a new action with testable shell scripts, add its name to this array. See ADDING_AN_ACTION.md.
All steps run sequentially in one job rather than as parallel matrix jobs. For fast-running bats suites, the overhead of spinning up multiple runners exceeds any parallelism benefit.
The Quality check produced by this workflow is a required status check on main. A PR cannot be merged until it passes.