Skip to content

Scrape latest data #826

Scrape latest data

Scrape latest data #826

Workflow file for this run

name: Scrape latest data
permissions:
contents: write
on:
push:
schedule:
- cron: '0 2 * * *'
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Fetch latest data
run: |
year=$(date --date="-3 months -5 days" +"%Y")
curl "https://gender-pay-gap.service.gov.uk/viewing/download-data/${year}" > "${year}-$((year+1)).csv"
- 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