-
Notifications
You must be signed in to change notification settings - Fork 102
55 lines (46 loc) · 1.4 KB
/
metadata-validation.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
48
49
50
51
52
53
54
55
name: Metadata Validation
on:
pull_request:
permissions:
contents: read
issues: write
pull-requests: write
jobs:
default:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: get_changed
uses: tj-actions/changed-files@v44
with:
files: "*-test-samples/**"
separator: ","
- name: Echo changed files
id: setfiles
run: |
files=${{ steps.get_changed.outputs.all_changed_files }}
echo $files
echo "FILES=$files" >> $GITHUB_OUTPUT
if [[ ! -z "$files" ]]; then
echo "run_validate=true" >> $GITHUB_OUTPUT
fi
- name: Set up Python 3.10
if: ${{ steps.setfiles.outputs.run_validate == 'true' }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install requirements
if: ${{ steps.setfiles.outputs.run_validate == 'true' }}
run: pip install -r .github/metadata/requirements.txt
- name: Validate Schema
if: ${{ steps.setfiles.outputs.run_validate == 'true' }}
run: python .github/metadata/metadata_json_validator.py
env:
ALL_CHANGED_FILES: ${{ steps.get_changed.outputs.all_changed_files }}
PR_NUMBER: ${{ github.event.number }}
GITHUB_AUTOMATION: true
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"