{{ message }}
Repository navigation
gh api query a empty json file #8848
Unanswered
rajesh-kareti-infovision
asked this question in
Q&A
Replies: 2 comments
|
set -o pipefail
gh api -H 'Accept: application/vnd.github.raw+json' \
'/repos/OWNER/REPO/contents/result.json?ref=BRANCH' | jq -r '.query // empty'I tested this with |
0 replies
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

Uh oh!
There was an error while loading. Please reload this page.
gh api -H "Accept: application/vnd.github.VERSION.raw" "/repos/BuddyTV/xxx/result.json?ref=xxx" -q 'query'
This is working fine when result.json has some value. but github action failing with error when result.json is empty.
Is there a way this query can return with out error when the json file is empty? return empty is fine but should not throw error
All reactions