Skip to content

Scrape latest data #30315

Scrape latest data

Scrape latest data #30315

Workflow file for this run

name: Scrape latest data
on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: '11 * * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
- name: Fetch latest data and calculate change
run: |-
curl https://service.stuttgart.de/lhs-services/stoerung/ > incidents.html
python main.py
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "[email protected]"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push