partially revert 194cb695

The REST API returned 4xx on unknown object but valid JSON body. As
written originally, valid JSON was assumed (result queried on null).

So revert back the original curl calls where acquiring JSON.
This commit is contained in:
Martin Pulec
2025-11-14 15:39:35 +01:00
parent c833d1adfa
commit f4f54fdae9
3 changed files with 3 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ dir=$(dirname "$0")
. "$dir/json-common.sh"
sudo apt install jq
URL=$(curl -Sf -H "Authorization: token $GITHUB_TOKEN" -X GET\
URL=$(curl -S -H "Authorization: token $GITHUB_TOKEN" -X GET\
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/continuous" |
jq -r '.url')
if [ "$URL" != null ]; then # release exists

View File

@@ -21,7 +21,7 @@ REPL_NL=':a;N;$!ba;s/\n/\\n/g'
markdown_replaces='s/\\_/\\\\_/g;s/\\\*/\\\\*/g' # escape MD escape sequences
sudo apt install jq
URL=$(curl -Sf -H "Authorization: token $GITHUB_TOKEN" -X GET\
URL=$(curl -S -H "Authorization: token $GITHUB_TOKEN" -X GET\
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases/tags/$TAG" |
jq -r '.url')
REQ=PATCH

View File

@@ -20,7 +20,7 @@ n=-1; while n=$((n + 1)); [ "$n" -lt "$LEN" ]; do
fi
ID=$(jq ".[$n].id" "$JSON")
JSON2=$(mktemp)
STATUS=$(curl -Sf -H "Authorization: token $GITHUB_TOKEN" -X DELETE \
STATUS=$(curl -S -H "Authorization: token $GITHUB_TOKEN" -X DELETE \
"https://api.github.com/repos/$GITHUB_REPOSITORY/releases/assets/$ID" \
-w '%{http_code}' -o "$JSON2")
check_errors "$JSON2"