Skip to content

Commit f0272b6

Browse files
committed
Add yaml linter to the CI pipeline
1 parent dcab2cd commit f0272b6

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

.github/workflows/linter.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,20 @@ jobs:
2424
echo "$results"
2525
exit 1
2626
fi
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@v5
30+
with:
31+
python-version: '3.9'
32+
33+
- name: Install yamllint
34+
run: pip install yamllint
35+
36+
- name: YAML linter
37+
run: |
38+
results=$(find . -type f -name "*.yaml" -o -name "*.yml" -exec yamllint {} \;)
39+
if [ -n "$results" ]; then
40+
echo "YAML files must be formatted with 'yamllint'. Please run 'yamllint' and commit the changes."
41+
echo "$results"
42+
exit 1
43+
fi

0 commit comments

Comments
 (0)