Skip to content

Metadata file validation fix. #390

Metadata file validation fix.

Metadata file validation fix. #390

name: Metadata Validation
on:
push:
permissions:
contents: read
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/**/metadata.json"
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.12
if: ${{ steps.setfiles.outputs.run_validate == 'true' }}
uses: actions/setup-python@v5
with:
python-version: "3.12"
- 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 ${{ steps.get_changed.outputs.all_changed_files }}