Skip to content

Commit 7c10872

Browse files
authored
Check all JSONs if PR doesn't change a JSON file (#15)
Ensures that changes to the check script are verified on everything.
1 parent 153afea commit 7c10872

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
branches: [ main ]
1010
pull_request:
1111

12+
env:
13+
YEAR: 2025
14+
1215
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1316
jobs:
1417
# This workflow contains a single job called "run-json-checker"
@@ -39,12 +42,12 @@ jobs:
3942
# Get list of added or modified JSON files in subdirectories
4043
git diff --diff-filter=AM --name-only $BASE_COMMIT HEAD | grep '.*/.*\.json$' > changed_json_files.txt || true
4144
42-
# Output the list of files
43-
echo "Changed JSON files in subdirectories:"
44-
cat changed_json_files.txt
45-
4645
# Run check.py on each existing JSON file
4746
if [ -s changed_json_files.txt ]; then
47+
# Output the list of files
48+
echo "Changed JSON files in subdirectories:"
49+
cat changed_json_files.txt
50+
4851
while read -r file; do
4952
if [ -f "$file" ]; then
5053
if [ -s "$file" ]; then
@@ -58,5 +61,6 @@ jobs:
5861
fi
5962
done < changed_json_files.txt
6063
else
61-
echo "No JSON files changed in subdirectories"
64+
echo "No JSON files changed in subdirectories, checking year: $YEAR"
65+
./check.py $YEAR/*.json
6266
fi

0 commit comments

Comments
 (0)