DEV Community

CodeWithCaen
CodeWithCaen

Posted on • Originally published at tips.desilva.se

Simple YAML Linter/Validator Workflow for GitHub Actions

Here's a quick tip if you work with YAML on GitHub!

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!

name: Validate YAML

on:
  push:
  pull_request:

jobs:
  validate-yaml:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Validate YAML file
        run: yamllint my-file.yml
Enter fullscreen mode Exit fullscreen mode

Top comments (0)