Skip to content

Scrape latest statement #451

Scrape latest statement

Scrape latest statement #451

Workflow file for this run

# inspired by https://github.com/simonw/ca-fires-history/blob/main/.github/workflows/scrape.yml
name: Scrape latest statement
on:
push:
workflow_dispatch:
schedule:
- cron: '0 8 * * 1'
permissions:
contents: write
jobs:
scheduled:
runs-on: ubuntu-latest
steps:
- name: Check out this repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- run: pip install -r requirements.txt
- name: Fetch latest data
run: python scrape.py
- name: Commit and push if it changed
run: |-
git config user.name "Automated"
git config user.email "actions@users.noreply.github.com"
git add -A
timestamp=$(date -u)
git commit -m "Latest data: ${timestamp}" || exit 0
git push