Skip to content

Update Japanese bus feeds #9476

Update Japanese bus feeds

Update Japanese bus feeds #9476

Workflow file for this run

name: Update Japanese bus feeds
on:
workflow_dispatch:
schedule:
- cron: '0 9 * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: |
external-data-for-reference/japan/*.py
scripts/*.py
- name: Install transitland-lib
run: scripts/install-transitland-lib.sh
- name: Fetch latest GTFS Data JP data (official source)
working-directory: external-data-for-reference/japan
run: uv run collect-gtfs-data-jp.py
- name: Fetch latest ODPT GTFS data
working-directory: external-data-for-reference/japan
run: uv run collect-odpt-gtfs.py
- name: Fetch latest data from tshimada291/gtfs-jp-list-datecheck
working-directory: external-data-for-reference/japan
run: uv run convert-tshimada291-list-csv-to-dmfr.py
- name: Format in the opinionated DMFR format
run: find ./feeds -type f -name "*.dmfr.json" -exec transitland dmfr format --save {} \;
- name: Validate feeds
working-directory: scripts
run: uv run validate-feeds.py
- name: Create branch, commit, and PR if changes exist
run: |
set -eu
git config user.name "Automated Bot"
git config user.email "info@interline.io"
if [ -z "$(git status --porcelain)" ]; then
echo "Working directory is clean."
exit 0
fi
echo "Working directory has uncommitted changes."
BRANCH_NAME="japanese-feeds-$(date +%F)-run-${{ github.run_number }}"
git checkout -b "${BRANCH_NAME}"
git add -A
git commit -m "Updated Japanese GTFS feeds from gtfs-data.jp, ODPT, and github.com/tshimada291/gtfs-jp-list-datecheck at $(date -u)"
git push --set-upstream origin "${BRANCH_NAME}"
gh pr create \
--title "Automatic update of Japanese GTFS feeds" \
--body "Automatically updated Japanese GTFS feeds from:
- gtfs-data.jp
- ODPT (Public Transportation Open Data Center)
- github.com/tshimada291/gtfs-jp-list-datecheck" \
--base main
gh workflow run validate.yaml --ref "${BRANCH_NAME}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}