Simple YAML Linter/Validator Workflow for GitHub Actions

CodeWithCaen - Jun 23 - - Dev Community

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
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .