Skip to content

ci: block merging PRs if jobs fail #16

ci: block merging PRs if jobs fail

ci: block merging PRs if jobs fail #16

Workflow file for this run

---
name: Lint YAML files
on: # yamllint disable-line rule:truthy
pull_request:
branches: ['*']
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install yamllint
run: |
python -m pip install --upgrade pip
pip install yamllint
- name: Lint YAML files
run: |
CHANGED_FILES=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }})
if echo "$CHANGED_FILES" | grep -qE '\.(yml|yaml)$'; then
echo -e "Running yamllint"
yamllint . || exit 1
else
echo -e "Skipping yamllint since no YAML files were changed."
fi