From 72ddacdbe91b87683ef1c712e6c9e49e9d4d0c79 Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Tue, 25 Jan 2022 14:30:56 -0500 Subject: Github workflow: Fix parsing of GraphQL response JSON While #12998 fixed the query string, it neglected to address presence of the old `githubRepository` field name in the reply. This resulted in the job throwing an error: `jq: error (at ./artifacts/reply.json:0): Cannot iterate over null` However, the job did preserve an artifacts archive containing the new response data. As a test for the fix in this commit, I ran the raw response data through the corrected jq command-line. This confirmed the change by properly parsing the data as expected by the workflow. Signed-off-by: Chris Evich --- .github/actions/check_cirrus_cron/cron_failures.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to '.github/actions') diff --git a/.github/actions/check_cirrus_cron/cron_failures.sh b/.github/actions/check_cirrus_cron/cron_failures.sh index 1d8f532d8..4fb3af98f 100755 --- a/.github/actions/check_cirrus_cron/cron_failures.sh +++ b/.github/actions/check_cirrus_cron/cron_failures.sh @@ -75,7 +75,7 @@ fi # e.x. reply.json # { # "data": { -# "githubRepository": { +# "ownerRepository": { # "cronSettings": [ # { # "name": "Keepalive_v2.0", @@ -102,7 +102,7 @@ fi # } # } # } -_filt='.data.githubRepository.cronSettings | map(select(.lastInvocationBuild.status=="FAILED") | { name:.name, id:.lastInvocationBuild.id} | join(" ")) | join("\n")' +_filt='.data.ownerRepository.cronSettings | map(select(.lastInvocationBuild.status=="FAILED") | { name:.name, id:.lastInvocationBuild.id} | join(" ")) | join("\n")' jq --raw-output "$_filt" ./artifacts/reply.json > "$NAME_ID_FILEPATH" echo " " -- cgit v1.2.3-54-g00ecf