fix: update release workflow to handle API response and improve error reporting
All checks were successful
Build & Release Plugin / release (push) Successful in 4s
All checks were successful
Build & Release Plugin / release (push) Successful in 4s
This commit is contained in:
15
.github/workflows/release.yml
vendored
15
.github/workflows/release.yml
vendored
@@ -171,21 +171,24 @@ jobs:
|
||||
json.dump(payload, handle, ensure_ascii=False)
|
||||
PY
|
||||
|
||||
RESPONSE=$(curl -sS -X POST "$API_URL/repos/$REPO/releases" \
|
||||
curl -sS -X POST "$API_URL/repos/$REPO/releases" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d @release.json)
|
||||
-d @release.json \
|
||||
-o release-response.json
|
||||
|
||||
RELEASE_ID=$(python3 - <<'PY'
|
||||
import json
|
||||
import sys
|
||||
data = json.loads(sys.stdin.read())
|
||||
|
||||
with open('release-response.json', 'r', encoding='utf-8') as handle:
|
||||
data = json.load(handle)
|
||||
|
||||
print(data.get('id', ''))
|
||||
PY
|
||||
<<< "$RESPONSE")
|
||||
)
|
||||
|
||||
if [ -z "$RELEASE_ID" ]; then
|
||||
echo "::error::Kon release-ID niet bepalen. Response: $RESPONSE"
|
||||
echo "::error::Kon release-ID niet bepalen. Response: $(cat release-response.json)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user