Scrape latest needs #169695
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |