Skip to content

Commit 8a45a29

Browse files
authored
Merge branch 'main' into gha-addressbook
2 parents 07cbf53 + 5eb8507 commit 8a45a29

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/checksum_addresses.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
PR_SHA: ${{ github.event.pull_request.head.sha }}
2323
run: |
2424
git fetch origin "$PR_SHA"
25-
git checkout "$PR_SHA" -- config/ extras/ 2>/dev/null || true
25+
git checkout "$PR_SHA" -- 'config/*.json' 'extras/*.json' 2>/dev/null || true
2626
2727
- name: Set up Python
2828
uses: actions/setup-python@v5

scripts/validate_checksums.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,11 @@ def fix_json_file(filepath: Path) -> tuple[int, list[tuple[str, str]]]:
9898
Fix all addresses in a JSON file.
9999
Returns (count of fixed addresses, list of invalid addresses that couldn't be fixed).
100100
"""
101-
with open(filepath) as f:
102-
data = json.load(f)
101+
try:
102+
with open(filepath) as f:
103+
data = json.load(f)
104+
except json.JSONDecodeError as e:
105+
return 0, [("", f"Invalid JSON: {e}")]
103106

104107
# Find all addresses and check for invalid ones
105108
addresses = find_addresses_in_obj(data)

0 commit comments

Comments
 (0)