Skip to content

Commit 37d7f53

Browse files
committed
add json validation
1 parent 97d3d23 commit 37d7f53

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/fetch-releases.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
2-
# This script downloads the latests release data from cadence-workflow repositories
32

3+
# This script downloads the latests release data from cadence-workflow repositories
44
gh api \
55
-H "Accept: application/vnd.github+json" \
66
-H "X-GitHub-Api-Version: 2022-11-28" \
@@ -17,3 +17,8 @@
1717
-H "Accept: application/vnd.github+json" \
1818
-H "X-GitHub-Api-Version: 2022-11-28" \
1919
/repos/cadence-workflow/cadence-java-client/releases > static/data/releases/cadence-java-client.json
20+
21+
# Validate json files, if any of the commands fail, the script will exit with a non-zero status
22+
cat static/data/releases/cadence.json | jq '.[] | has("tag_name") and has("body")' -e > /dev/null
23+
cat static/data/releases/cadence-go-client.json | jq '.[] | has("tag_name") and has("body")' -e > /dev/null
24+
cat static/data/releases/cadence-java-client.json | jq '.[] | has("tag_name") and has("body")' -e > /dev/null

0 commit comments

Comments
 (0)