-
Notifications
You must be signed in to change notification settings - Fork 330
31 lines (28 loc) · 926 Bytes
/
check.yaml
File metadata and controls
31 lines (28 loc) · 926 Bytes
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
name: Validate JSON files
on:
pull_request:
paths:
- "testnet/*.json"
- "mainnet/*.json"
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -r scripts/requirements.txt
- name: Validating changed files
env:
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
run: |
git fetch origin ${{ github.base_ref }}
# Get list of changed files, excluding deleted files (--diff-filter=d)
# since we can't validate files that no longer exist
FILES="$(git diff --name-only --diff-filter=d origin/${{ github.base_ref }}...HEAD | grep -E '^(testnet|mainnet)/' || true)"
for FILE in $FILES; do
python scripts/validate.py "$FILE"
done