forked from technologiestiftung/weihnachtsmarktkarte
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.11 KB
/
check_for_changes.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
33
34
35
36
37
38
39
name: CheckForChanges
on:
schedule:
- cron: "40 12 * * *"
jobs:
checkForChanges:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: UseNode
uses: actions/setup-node@v3
with:
node-version: "20.x"
- name: ScrapeMarkets
run: |
cd ./scraper
npm install
npm run leipzigde
git diff markets_leipzig_de.json | echo >> git_diff.txt
if [ -s git_diff.txt ]; then echo "HAS_CHANGES=TRUE" >> "$GITHUB_OUTPUT"; fi
- name: UploadWeihnachtsmaerkte
if: ${{ steps.ScrapeMarkets.outputs.HAS_CHANGES }}
uses: actions/upload-artifact@v3
with:
name: weihnachts_maerkte_leipzigde.json
path: markets_leipzig_de.json
retention-days: 1
- name: UploadDiff
if: ${{ steps.ScrapeMarkets.outputs.HAS_CHANGES }}
uses: actions/upload-artifact@v3
with:
name: git_diff.txt
path: git.diff
retention-days: 1
- name: FailOnChanges
if: ${{ steps.ScrapeMarkets.outputs.HAS_CHANGES }}
run: exit 1