-
Notifications
You must be signed in to change notification settings - Fork 255
50 lines (44 loc) · 1.46 KB
/
validate-yml-schema.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
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 }}"