-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.05 KB
/
fetch-test.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
40
41
42
43
44
45
46
47
name: Fetch test
on:
push:
branches: ["*"]
pull_request:
branches: ["*"]
jobs:
fetch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "14"
cache: yarn
- name: Installing
run: yarn --frozen-lockfile --perfer-offline --link-duplicates
- name: Fetch data
run: |
yarn fetch
- name: Get metadata
id: metadata
shell: bash
run: |
echo "::set-output name=data_status::$(git status -s ./data)"
echo "::set-output name=now::$(date +"%Y%m%d_%H%M")"
- name: Print metadata
run: |
echo "Data status ${{ steps.metadata.outputs.now }}"
echo "${{ steps.metadata.outputs.data_status }}"
- name: Check JSON
run: |
for filename in ./data/*\.json; do
node "$filename" > /dev/null || {
echo "Invalid JSON in $filename"
exit 1
}
done