diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1e64bf54..acef70e3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -115,6 +115,28 @@ jobs: name: build-from-main path: main + - name: Normalise JSON + shell: python + run: | + import json + from pathlib import Path + + ROOTS = [ + Path('main/_site'), + Path('local/_site'), + ] + 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: |