Skip to content

Commit

Permalink
feat: generate diff files using jq for big jsonld files (#15)
Browse files Browse the repository at this point in the history
* feat: run diff for jsonld files before commit

* fix: diff script

* chore: catch unlocode.jsonld download exit code

* chore: check diff script exit codes

* update UN/LOCODE vocabulary

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
kshychko and github-actions[bot] authored May 31, 2024
1 parent 16838b4 commit f0906c9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ jobs:
mv unlocode-sorted.jsonld unlocode.jsonld
mv *.jsonld ../../vocab/
- name: runn diff
working-directory: vocab/
run: |
curl -o unlocode-main.jsonld https://raw.githubusercontent.com/uncefact/vocabulary-outputs/main/unlocode.jsonld && echo "Downloaded"
diff <(jq --sort-keys . unlocode-main.jsonld) <(jq --sort-keys . unlocode.jsonld) > unlocode-diff.txt && echo "Diff created"
curl -o unlocode-subdivisions-main.jsonld https://raw.githubusercontent.com/uncefact/vocabulary-outputs/main/unlocode-subdivisions.jsonld && echo "Downloaded"
diff <(jq --sort-keys . unlocode-subdivisions-main.jsonld) <(jq --sort-keys . unlocode-subdivisions.jsonld) > unlocode-subdivisions-diff.txt && echo "Diff created"
rm unlocode-main.jsonld && echo "File removed"
rm unlocode-subdivisions-main.jsonld && echo "File removed"
- name: commit json-ld
working-directory: vocab/
run: |
Expand Down
2 changes: 2 additions & 0 deletions vocab/unlocode-diff.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
7a8
> "unlcdf": "https://vocabulary.uncefact.org/unlocode-functions#",
Empty file.

0 comments on commit f0906c9

Please sign in to comment.