Add yamlfmt #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: test-yaml-format | |
on: [push, pull_request] | |
jobs: | |
yaml_style_check: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '>=1.17.0' | |
- run: go version | |
- name: check yaml changes | |
run: | | |
go install github.com/google/yamlfmt/cmd/yamlfmt@latest | |
yamlfmt ./**/**.yaml | |
yamlfmt ./**/**.yml | |
- name: Verify Changed files | |
uses: tj-actions/verify-changed-files@v16 | |
id: verify-changed-files | |
with: | |
files: | | |
**/*.yaml | |
**/*.yml | |
- name: Run step only when any of the above files change. | |
if: steps.verify-changed-files.outputs.files_changed == 'true' | |
run: |- | |
echo "Changed files: ${{ steps.verify-changed-files.outputs.changed_files }}" | |
false |