Skip to content

Commit

Permalink
Make curl exit with error code if request fails
Browse files Browse the repository at this point in the history
Issue #42
  • Loading branch information
Douile committed Apr 14, 2022
1 parent 5820b91 commit 44c818b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ NAME="${ARCHIVE_NAME:-${PROJECT_NAME}_${RELEASE_NAME}_${RUSTTARGET}}"
ARCHIVE_TYPES="${ARCHIVE_TYPES:-"zip"}"
EXTRA_FILES="${EXTRA_FILES:-""}"

if [ -z "${EXTRA_FILES+x}" ]; then
if [ -z "${EXTRA_FILES+Sx}" ]; then
echo "::warning file=entrypoint.sh::EXTRA_FILES not set"
else
for file in $(echo -n "${EXTRA_FILES}" | tr " " "\n"); do
Expand Down Expand Up @@ -86,13 +86,15 @@ for ARCHIVE_TYPE in $ARCHIVE_TYPES; do
FILE_NAME="${NAME}.${ARCHIVE/tmp./}"

curl \
--fail-with-body -sS \
-X POST \
--data-binary @"${ARCHIVE}" \
-H 'Content-Type: application/octet-stream' \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${UPLOAD_URL}?name=${FILE_NAME}"

curl \
--fail-with-body -sS \
-X POST \
--data "$CHECKSUM ${FILE_NAME}" \
-H 'Content-Type: text/plain' \
Expand Down

0 comments on commit 44c818b

Please sign in to comment.