-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (31 loc) · 899 Bytes
/
json_format.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
name: JSON formatting checker
on:
push:
paths:
- "*-device-identifiers*.json"
pull_request:
paths:
- "*-device-identifiers*.json"
jobs:
format:
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Install Node.js, NPM
uses: actions/setup-node@v4
with:
node-version: 16
- name: Format JSON files
run: |
for file in *.json; do
npx jsonlint -i "$file"
done
- name: Check JSON files have changed
run: |
git diff --exit-code --quiet *-device-identifiers*.json
- name: Check mac-device-identifiers.json is unique
run: |
length1=`cat mac-device-identifiers.json | jq length`
length2=`cat mac-device-identifiers-unique.json | jq length`
test $length1 = $length2