Skip to content

Merge pull request #221 from BlockPILabs/stage #225

Merge pull request #221 from BlockPILabs/stage

Merge pull request #221 from BlockPILabs/stage #225

Workflow file for this run

name: 代码格式验证
on:
push:
pull_request:
jobs:
code-review:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
**/*.json
**/*.yaml
**/*.yml
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install PyYAML
- name: Validate JSON and YAML files
run: |
if [ "${{ steps.changed-files.outputs.any_changed }}" = "true" ]; then
echo "Changed files: ${{ steps.changed-files.outputs.all_changed_files }}"
python .github/scripts/validate_files.py --changed-files ${{ steps.changed-files.outputs.all_changed_files }} --check-json --check-yaml
else
echo "No JSON or YAML files changed"
fi