Skip to content

Updated entries 2024 week 28 #663

Updated entries 2024 week 28

Updated entries 2024 week 28 #663

Workflow file for this run

name: Check JSON files
on:
push:
branches:
- '**'
paths-ignore:
- 'README.md'
- '.gitignore'
- '.gitattributes'
- '.github/ISSUE_TEMPLATE/**/*'
- '.github/CONTRIBUTING.md'
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install jsonlint-cli -g
- name: Lint dataset
run: jsonlint-cli *.json
- name: Lint dead-entries
run: jsonlint-cli dead-entries/*.json
check-commit-message:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check commit message
id: check_message
run: |
MESSAGE=$(git log --format=%B -n 1 ${{ github.event.after }})
if [[ "$MESSAGE" == "Updated entries"* ]]; then
echo "run_schema_validation=true" >> "$GITHUB_OUTPUT"
else
echo "run_schema_validation=false" >> "$GITHUB_OUTPUT"
fi
outputs:
run_schema_validation: ${{ steps.check_message.outputs.run_schema_validation }}
dataset-validation:
needs: check-commit-message
if: ${{ needs.check-commit-message.outputs.run_schema_validation == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cardinalby/schema-validator-action@v3
with:
file: 'anime-offline-database.json'
schema: 'anime-offline-database.schema.json'
dataset-minified-validation:
needs: check-commit-message
if: ${{ needs.check-commit-message.outputs.run_schema_validation == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cardinalby/schema-validator-action@v3
with:
file: 'anime-offline-database-minified.json'
schema: 'anime-offline-database.schema.json'
dead-entries-validation:
needs: check-commit-message
if: ${{ needs.check-commit-message.outputs.run_schema_validation == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cardinalby/schema-validator-action@v3
with:
file: 'dead-entries/anidb.json|dead-entries/anidb-minified.json|dead-entries/anilist.json|dead-entries/anilist-minified.json|dead-entries/kitsu.json|dead-entries/kitsu-minified.json|dead-entries/myanimelist.json|dead-entries/myanimelist-minified.json'
schema: 'dead-entries/dead-entries.schema.json'