30 lines
691 B
YAML
30 lines
691 B
YAML
name: Lint on PR
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
jobs:
|
|
lint:
|
|
name: Lint YAML files
|
|
runs-on: docker
|
|
container:
|
|
image: mafyuh/node-yamllint:v1.0.0
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
|
|
- name: Show yamllint version
|
|
run: |
|
|
yamllint --version
|
|
|
|
- name: Lint .yml files
|
|
run: |
|
|
lint_output=$(find docker -name "*.yml" -exec yamllint -d "{extends: relaxed, rules: {line-length: {max: 120}}}" {} \;)
|
|
|
|
# Check if there are any issues
|
|
if [[ -n "$lint_output" ]]; then
|
|
echo "$lint_output"
|
|
exit 1
|
|
fi
|