Skip to content

ci: add linting for yml files #4

ci: add linting for yml files

ci: add linting for yml files #4

Workflow file for this run

name: lint-yml
on:
push:
branches: ["main"]
paths:
- "**.yml"
pull_request:
paths:
- "**.yml"
env:
GO_VERSION: '1.23.0'
jobs:
lint-yml:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
yml:
- added|modified: '**.yml'
- name: Set up Go
if: steps.changes.outputs.yml == 'true'
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Get yamlfmt
if: steps.changes.outputs.yml == 'true'
run: go install github.com/google/yamlfmt/cmd/yamlfmt@latest
- name: Run yamlfmt
if: steps.changes.outputs.yml == 'true'
run: yamlfmt -lint -quiet $(find . -name '*.yml')