fix(release): parse release id robustly and validate upload endpoint
Use JSON parsing for release id extraction in publish action instead of regex matching, preventing wrong id selection from nested fields. Add a pre-upload release endpoint check to fail early with explicit release URL diagnostics when the resolved id/path is invalid.
This commit is contained in:
@@ -275,6 +275,15 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
release_detail_api="${GITHUB_API_URL:-${GITHUB_SERVER_URL%/}/api/v1}/repos/${GITHUB_REPOSITORY}/releases/${release_id}"
|
||||
if ! curl --fail-with-body -sS \
|
||||
-H "Authorization: token ${RELEASE_TOKEN}" \
|
||||
-H "Content-Type: application/json" \
|
||||
"$release_detail_api" >/dev/null; then
|
||||
echo "Resolved release endpoint is not accessible: ${release_detail_api}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
release_api="${GITHUB_API_URL:-${GITHUB_SERVER_URL%/}/api/v1}/repos/${GITHUB_REPOSITORY}/releases/${release_id}/assets"
|
||||
|
||||
for asset in dist/*; do
|
||||
|
||||
Reference in New Issue
Block a user