
GitHub Actions: Lint and Fix Your Workflow YAML
Broken YAML, missing `on` or `jobs`, empty steps: structurally validate workflows before you push — and keep actionlint in CI.
Checking a workflow before you merge to main
A .github/workflows/*.yml file that does not parse, or a job with no runs-on, often shows up only after you push: red check, GitHub logs, blocked review. FastMinify does not ship actionlint. The GitHub Actions validator runs structural checks in the browser (on, jobs, steps with run or uses). The GitHub Actions formatter fixes the YAML indentation to the 2-space convention. The full cluster lives on the CI/CD tools hub. To automate JS/CSS minification in the pipeline, see the CI/CD minification guide.
Workflow anatomy, and what FastMinify checks or leaves out
A workflow is a single YAML document. GitHub expects an on trigger and a jobs mapping. Each job needs a runner through runs-on, a reusable workflow through uses, or a steps list. Each step must define run or uses.
---) are rejecteduses without steps is accepted; nested YAML is not deeply inspectedjobs map or empty steps list yields a warning, not always a blocking erroron triggers after a successful parseFastMinify exposes two tools. Neither is actionlint. Mixing the three up produces workflows that look “valid” and still fail in CI.
Before
After
js-yaml round-trip with a 2-space indent (GitHub convention), see format-github-actionson, jobs, and steps, see validate-github-actions${{ }} expressions, permissions, IDs, and action lookup, to run in CI and not in FastMinifyactions/checkout@v4 exists or that an expression is safeInterpolating untrusted context (github.event.issue.title, a PR label) straight into run: is a classic script-injection pattern. FastMinify does not evaluate expressions and does not flag that motif.
env:, not by interpolating them into the scriptpermissions: at the minimum (contents, pull-requests)run or uses, even if the script is unsafeValidate, then format, as a concrete workflow
Open the GitHub Actions validator, paste a single workflow file (max 512 KiB), and wait for the short debounce delay (~300 ms). The panel shows a verdict, issues with a line hint on parse errors, and job, step, and trigger counts. Empty input stays idle and is not reported as invalid.
The GitHub Actions formatter rewrites YAML through js-yaml. Paste, upload, or load the sample, and it formats automatically. After a manual edit, use the Format button (⌘↵). The interface indent follows the 2-space convention. This is not a semantic rewriter.
A teammate added - name: empty step with no script. CI fails late, with a GitHub message that is hard to read in the PR overlay.
Paste the workflow into validate-github-actions
Open validate-github-actions. An invalid verdict such as “step needs run or uses” points at the empty step.
Add run or uses
Replace the step with uses: actions/checkout@v4 or a real run:. Re-paste until the panel shows a valid structure.
Format and open the PR
Send the fixed YAML through format-github-actions, copy it, and commit. Reviewers read indented jobs, not a one-line blob.
An example copied from GitHub docs or a gist arrives with mixed spaces. You can no longer see where a job ends.
Format first if you cannot even read the file
Paste into format-github-actions. This step does not prove the workflow is structurally complete.
Validate the indented document
Copy the output into the validator. Check on, jobs, and that every step has an action.
Keep actionlint for CI
Once the shape is OK, expressions, IDs, and marketplace checks stay in the pipeline, because FastMinify does not replace that gate.
Keep actionlint (and minify) in CI
The browser is the fast loop before git push. Teams still keep actionlint as a merge gate for ${{ }} expressions and rules FastMinify does not implement. The snippet follows the official actionlint download script, so pin a version in your repo rather than a floating main. To minify JS/CSS in the same pipeline, see the CI/CD minification guide.
Basic example
If the repo is on GitLab, the counterparts are format-gitlab-ci and validate-gitlab-ci, with the same idea of YAML plus structure and no runner. Dockerfile and Compose stay on the DevOps hub: lint a Dockerfile and validate Compose and .env.
Conclusion
Paste the workflow, fix the structure (on, jobs, steps), fix the indentation, then push. FastMinify runs that loop locally and never uploads the YAML. It is not actionlint: expressions, advanced permissions, and whether an action exists stay in CI and review. For generic YAML, stay on beautify-yaml; for GitLab, on the same CI/CD hub.
Validate or format a GitHub Actions workflow now
Related Articles

Paste a token and a JWKS to check an RS256, ES256 or HS256 signature in your browser. How kid picks the key, measured errors and the claims to check.

HTTP/2 and HTTP/3 change how files travel, not how big they are. Measured sizes, compile times and bundling tests show what minification still saves.

Convert a Unix epoch to a readable date and back, tell seconds from milliseconds, and avoid time zone, JWT and clock change traps, all in your browser.