Skip to main content

Module workflow_lint

Module workflow_lint 

Source
Expand description

workflow-lint — flag a program encoded in GitHub Actions YAML.

A run: or actions/github-script body should be wiring: a few straight-line commands, or a lone guard around an early exit. Iteration, multi-branch dispatch, and text-munging make it a program, and a program in YAML is untested, un-runnable locally, and drifts in silence. It belongs in a tested package in the repository’s own language, invoked as a one-line run:.

This is a pragmatic scanner, not a shell parser: it flags the high-signal markers of “this is a program” and tolerates straight-line glue. It favors precision over recall — a borderline body that slips through is still worth extracting, because an extracted script is testable.

Structs§

Finding
One step whose body encodes logic.

Constants§

MAX_GLUE_LINES
Straight-line bodies longer than this must move out, branch-free or not: past a dozen commands the step is a script whatever its control flow.

Functions§

find_violations
Every logic-bearing step in one workflow or composite-action document.
flag_reasons
Why body is too complex to live inline. Empty means it reads as wiring.
scan
Every logic-bearing step under path — a workflow file, or a directory to search — in file-then-line order.