Skip to content

Scrape latest needs #152419

Scrape latest needs

Scrape latest needs #152419

Workflow file for this run

name: Scrape latest needs
on:
push:
workflow_dispatch:
schedule:
- cron: '* * * * *'
jobs:
scheduled:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out this repo
uses: actions/checkout@v2
- name: Fetch latest JSON data
run: |-
curl https://www.givefood.org.uk/api/2/needs/ > needs.json
- name: Fetch latest XML data
run: |-
curl https://www.givefood.org.uk/api/2/needs/?format=xml > needs.xml
- name: Fetch latest YAML data
run: |-
curl https://www.givefood.org.uk/api/2/needs/?format=yaml > needs.yaml
- 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 need data: ${timestamp}" || exit 0
git push