-
Notifications
You must be signed in to change notification settings - Fork 866
59 lines (55 loc) · 2.38 KB
/
validate.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
48
49
50
51
52
53
54
55
56
57
58
59
name: Validate filenames & JSON informations
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
validation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt install imagemagick-6.q16
- name: Collecting file paths
run: |
# Collect all JSON files in 'tokens' directories
echo "TOKENS_FILE_PATHS=$(find . -type f -path '*/tokens/*.json' ! -name 'ranks.json' -printf '%p,' | sed 's/,$//')" >> $GITHUB_ENV
# Collect all JSON files in 'accounts' directories
echo "ACCOUNTS_FILE_PATHS=$(find . -type f -path '*/accounts/*.json' -printf '%p,' | sed 's/,$//')" >> $GITHUB_ENV
# Collect all JSON files in 'identities' directories
echo "IDENTITIES_FILE_PATHS=$(find . -type f -path '*/identities/*.json' -printf '%p,' | sed 's/,$//')" >> $GITHUB_ENV
- id: files
uses: jitterbit/get-changed-files@v1
- name: Validate file size
run: |
source .github/snippet.sh ; validate_file_size ${{ steps.files.outputs.added_modified }}
- name: Validate filenames
run: |
source .github/snippet.sh ; validate_filenames ${{ steps.files.outputs.added_modified }}
- name: Validate png dimensions
run: |
source .github/snippet.sh ; validate_png_dimensions ${{ steps.files.outputs.added_modified }}
- name: Validate svg square
run: |
source .github/snippet.sh ; validate_svg_square ${{ steps.files.outputs.added_modified }}
- name: Validate token existence
run: |
source .github/snippet.sh; validate_token_existence
- name: Validate tokens JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: ./.github/schemas/tokens-schema.json
INPUT_JSONS: ${{ env.TOKENS_FILE_PATHS }}
- name: Validate accounts JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: ./.github/schemas/accounts-schema.json
INPUT_JSONS: ${{ env.ACCOUNTS_FILE_PATHS }}
- name: Validate identities JSON
uses: docker://orrosenblatt/validate-json-action:latest
env:
INPUT_SCHEMA: ./.github/schemas/identities-schema.json
INPUT_JSONS: ${{ env.IDENTITIES_FILE_PATHS }}