Validate yml schemas #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Validate yml schemas | |
########################################## | |
# Start the job on PR for all branches # | |
######################################### | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- ready_for_review | |
paths: | |
- "services/**/**/**.yaml" | |
workflow_dispatch: { } | |
jobs: | |
validate-yaml-files: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{github.event.pull_request.head.ref}} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: Get all changed yaml files | |
id: changed-yaml-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: | | |
services/**/**/**.yaml | |
- name: List all changed yaml files | |
if: steps.changed-yaml-files.outputs.any_changed == 'true' | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-yaml-files.outputs.all_changed_files }} | |
run: | | |
for file in ${ALL_CHANGED_FILES}; do | |
echo "File changed: $file" | |
done | |
- name: validate yaml files | |
id: validate-yaml-files | |
if: steps.changed-yaml-files.outputs.any_changed == 'true' | |
run: | | |
python .github/yml-schemas/validate_yml.py "${{ steps.changed-yaml-files.outputs.all_changed_files }}" | |