删除其他链的cache #223
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |