Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

set -euo pipefail

BRANCH_NAME="${GITHUB_REF##*/}"
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
SANITIZED_BRANCH_NAME=$(echo "$BRANCH_NAME" | tr '[:upper:]' '[:lower:]' | \
sed -e 's/[\/_ ]/-/g' \
-e 's/[#!@.]//g')

# Make the request and capture both the body and status code
HTTP_RESPONSE=$(curl --silent --location "${NIMBUS_SERVER}/deploy" --write-out "HTTPSTATUS:%{http_code}" \
--header "X-Api-Key: ${NIMBUS_API_KEY}" \
--form "file=@${NIMBUS_PATH}" \
--form "branch=${BRANCH_NAME}")
--form "branch=${SANITIZED_BRANCH_NAME}")

# Extract the body and the status code
HTTP_BODY=$(echo "$HTTP_RESPONSE" | sed -e 's/HTTPSTATUS\:.*//g')
Expand Down