pez-infra/.github/workflows/lint-ansible.yml
Rasmus Wejlgaard 7f5cbf83c3 Remove ansible-lint on push, keep PR-only
Lint already runs on pull_request — no need to double up on push to main.
2026-03-29 20:10:34 +00:00

30 lines
762 B
YAML

name: Lint Ansible
on:
pull_request:
paths:
- 'ansible/**'
- '.github/workflows/lint-ansible.yml'
jobs:
ansible-lint:
name: ansible-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for Ansible files
id: check
run: |
if find ansible/ -name '*.yml' -o -name '*.yaml' | grep -q .; then
echo "has_files=true" >> "$GITHUB_OUTPUT"
else
echo "has_files=false" >> "$GITHUB_OUTPUT"
echo "No Ansible YAML files found — skipping lint."
fi
- name: Run ansible-lint
if: steps.check.outputs.has_files == 'true'
uses: ansible/ansible-lint@v25
with:
working_directory: ansible/