Files
NSPanel_HA_Blueprint/.github/workflows/validate_yamllint.yml
Edward Firmo e06cd0d464 Lint
2024-01-11 17:01:46 +01:00

35 lines
824 B
YAML

---
name: Validate YAML
# yamllint disable-line rule:truthy
on:
push:
pull_request:
workflow_dispatch:
jobs:
code_scan:
name: Validate YAML
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4.1.0
- name: Identify changed files
uses: tj-actions/changed-files@v41
id: changed-files
with:
files: '**/*.y*ml'
separator: ","
- name: Validate YAML
if: steps.changed-files.outputs.any_changed == 'true'
run: |
IFS=',' read -ra FILES <<< "${{ steps.changed-files.outputs.all_changed_files }}"
for file in "${FILES[@]}"; do
echo "::group::Validating $file"
yamllint -c "./.rules/yamllint.yml" "$file"
echo "::endgroup::"
done
...