-
Notifications
You must be signed in to change notification settings - Fork 7
32 lines (30 loc) · 904 Bytes
/
scrape_needs.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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