Skip to content

feat: update PostgreSQL stack version to 1.5.3 and add Authelia API p… #80

feat: update PostgreSQL stack version to 1.5.3 and add Authelia API p…

feat: update PostgreSQL stack version to 1.5.3 and add Authelia API p… #80

Workflow file for this run

name: Validate Playbook Syntax
on:
push:
branches:
- main
paths:
- 'catalog/[a-z]/**'
- '!**.md'
pull_request:
paths:
- 'catalog/[a-z]/**'
- '!**.md'
workflow_dispatch:
jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install ansible ansible-lint check-jsonschema
- name: Find changed playbooks
id: changes
run: |
# On manual trigger, validate ALL playbooks
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "Manual trigger detected - validating ALL playbooks"
all_dirs=$(find catalog -mindepth 2 -maxdepth 2 -type d | sort | tr '\n' ' ')
echo "dirs=$all_dirs" >> $GITHUB_OUTPUT
exit 0
fi
# Determine base and head refs for automatic triggers
if [ "${{ github.event_name }}" = "push" ]; then
BASE_REF="${{ github.event.before }}"
HEAD_REF="${{ github.sha }}"
else
BASE_REF="origin/${{ github.base_ref }}"
HEAD_REF="${{ github.sha }}"
fi
# Find changed playbooks and convert newlines to spaces
changed_dirs=$(./scripts/find-changed-playbooks.sh "$BASE_REF" "$HEAD_REF" | tr '\n' ' ' || true)
# Export as single-line space-separated output
echo "dirs=$changed_dirs" >> $GITHUB_OUTPUT
- name: Check if any playbooks to validate
if: steps.changes.outputs.dirs == ''
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "No playbooks found in catalog."
echo "### No Playbooks" >> $GITHUB_STEP_SUMMARY
echo "No playbooks found in catalog directory." >> $GITHUB_STEP_SUMMARY
else
echo "No playbook changes detected in this push."
echo "### No Changes" >> $GITHUB_STEP_SUMMARY
echo "No playbook changes detected." >> $GITHUB_STEP_SUMMARY
fi
- name: Validate JSON syntax
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-json-syntax.sh ${{ steps.changes.outputs.dirs }}
- name: Validate against JSON Schema
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-json-schema.sh ${{ steps.changes.outputs.dirs }}
- name: Validate required fields
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-manifest-fields.sh ${{ steps.changes.outputs.dirs }}
- name: Validate YAML syntax
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-yaml-syntax.sh ${{ steps.changes.outputs.dirs }}
- name: Run ansible-lint
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-ansible-lint.sh ${{ steps.changes.outputs.dirs }}
- name: Validate category
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-category.sh ${{ steps.changes.outputs.dirs }}
- name: Validate zero external dependencies
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-no-external-deps.sh ${{ steps.changes.outputs.dirs }}
- name: Validate os_support format
if: steps.changes.outputs.dirs != ''
run: |
./scripts/validate-os-support.sh ${{ steps.changes.outputs.dirs }}
- name: Validate unique playbook IDs
run: |
./scripts/validate-unique-ids.sh
- name: Summary
if: always() && steps.changes.outputs.dirs != ''
run: |
echo "### Validation Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "Validated all playbooks:" >> $GITHUB_STEP_SUMMARY
else
echo "Changed playbooks:" >> $GITHUB_STEP_SUMMARY
fi
echo '```' >> $GITHUB_STEP_SUMMARY
echo "${{ steps.changes.outputs.dirs }}" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY