Skip to content

Simple YAML Linter/Validator Workflow for GitHub Actions

Posted by author

The GitHub Actions Ubuntu runners comes with yamllint installed, meaning it's super simple to create linting/validating workflows to ensure your YAML is valid!

Filepath: .github/workflows/lint.yml
1name: Validate YAML
2 
3on:
4 push:
5 pull_request:
6 
7jobs:
8 validate-yaml:
9 runs-on: ubuntu-latest
10 steps:
11 - uses: actions/checkout@v4
12 - name: Validate YAML file
13 run: yamllint my-file.yml

Syntax highlighting by Torchlight.dev

End of article