-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (41 loc) · 1.34 KB
/
pr.yaml
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: PR Validation
on:
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'cfg/*/*.yaml'
jobs:
validate-yaml:
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip' # caching pip dependencies
cache-dependency-path: scripts/requirements.txt
- name: Get changed files
id: changed-files-yaml
uses: tj-actions/changed-files@v45
with:
files_yaml: |
cfg:
- 'cfg/*/*.yaml'
- name: Install dependencies
run: |
pip install -r scripts/requirements.txt
- name: Validate YAML
if: steps.changed-files-yaml.outputs.cfg_any_changed == 'true'
env:
CFG_ALL_CHANGED_FILES: ${{ steps.changed-files-yaml.outputs.cfg_all_changed_files }}
PR_AUTHOR: ${{ github.event.pull_request.user.login }}
PR_NUMBER: ${{ github.event.number }}
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
run: python scripts/validate_yaml.py