Skip to content

Commit 1a55ef3

Browse files
committed
Normalise the JSON redirects file before diffing
This ensures that key-ordering changes, which don't affect the semantics of the file, don't create diff noise.
1 parent 1091b8d commit 1a55ef3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/publish.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,28 @@ jobs:
121121
popd
122122
mv artifact.tar main.tar
123123
124+
- name: Normalise JSON
125+
shell: python
126+
run: |
127+
import json
128+
from pathlib import Path
129+
130+
ROOTS = [
131+
Path('main'),
132+
Path('local'),
133+
]
134+
FILES = [
135+
'redirects.json',
136+
]
137+
138+
for root in ROOTS:
139+
for name in FILES:
140+
p = root / name
141+
p.write_text(json.dumps(
142+
json.loads(p.read_text()),
143+
sort_keys=True,
144+
))
145+
124146
- name: Diff
125147
id: diff
126148
run: |

0 commit comments

Comments
 (0)