California #1627
Workflow file for this run
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: Validate | |
| on: [push, pull_request_target, workflow_dispatch] | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| DMFR_SCHEMA_VERSION: v0.6.0 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| fetch-depth: 0 | |
| # Only needed for fork PRs - security check | |
| - name: Security check for fork PRs | |
| if: ${{ github.event.pull_request.head.repo.full_name != github.repository }} | |
| run: | | |
| # Check if PR modifies .github or scripts directories | |
| if git diff --name-only ${{ github.event.pull_request.head.sha }} ${{ github.event.pull_request.base.sha }} | grep -q -E "^\.github/|^scripts/"; then | |
| echo "Error: PR contains changes to .github or scripts directories, which is not allowed for security reasons" | |
| exit 1 | |
| fi | |
| - uses: astral-sh/setup-uv@v7 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20.x' | |
| - name: Install transitland-lib | |
| run: scripts/install-transitland-lib.sh | |
| - name: Validate against DMFR schema | |
| run: | | |
| wget https://dmfr.transit.land/json-schema/dmfr.schema-${{ env.DMFR_SCHEMA_VERSION }}.json -O dmfr.schema.json | |
| npx ajv-cli validate -s dmfr.schema.json -d "feeds/*.json" | |
| - name: Lint against the opinionated DMFR format | |
| run: | | |
| transitland dmfr lint feeds/*.dmfr.json | |
| - name: Validate against transitland-lib | |
| env: | |
| DMFR_SCHEMA_VERSION: ${{ env.DMFR_SCHEMA_VERSION }} | |
| working-directory: scripts | |
| run: uv run validate-feeds.py |