Skip to content

Commit

Permalink
Normalise the JSON redirects file before diffing
Browse files Browse the repository at this point in the history
This ensures that key-ordering changes, which don't affect the
semantics of the file, don't create diff noise.
  • Loading branch information
PeterJCLaw committed Aug 3, 2024
1 parent 1091b8d commit 1a55ef3
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,28 @@ jobs:
popd
mv artifact.tar main.tar
- name: Normalise JSON
shell: python
run: |
import json
from pathlib import Path
ROOTS = [
Path('main'),
Path('local'),
]
FILES = [
'redirects.json',
]
for root in ROOTS:
for name in FILES:
p = root / name
p.write_text(json.dumps(
json.loads(p.read_text()),
sort_keys=True,
))
- name: Diff
id: diff
run: |
Expand Down

0 comments on commit 1a55ef3

Please sign in to comment.