Skip to content

ci: use yamlfmt binary directly #7

ci: use yamlfmt binary directly

ci: use yamlfmt binary directly #7

Workflow file for this run

name: lint-yml
on:
push:
branches: ["main"]
paths:
- "**.yml"
pull_request:
paths:
- "**.yml"
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: Get yamlfmt
if: steps.changes.outputs.yml == 'true'
run: |
LATEST_VERSION=$(curl -s https://api.github.com/repos/google/yamlfmt/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^v//')
./.github/scripts/get-yamlfmt.sh "Linux" "amd64" "$LATEST_VERSION"
- name: Run yamlfmt
if: steps.changes.outputs.yml == 'true'
run: ./yamlfmt -lint -quiet $(find . -name '*.yml')