Fixed URL encoding accordingly to GitHub (#11)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2024-06-26 09:13:36 +02:00
1 parent 6170e0ce9a
commit 50a03e6c9d
2 files changed
+6 -14

No files matched your search

+5 -13
View File
@@ -662,18 +662,6 @@ jobs:
# Here, we create the JSON object:
platforms_json=$(jq -n '{}')
# Define the urlencode function:
urlencode() {
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:i:1}"
case $c in
[a-zA-Z0-9.~_-]) printf "$c" ;;
*) printf '%%%02X' "'$c" ;;
esac
done
}
# Display the structure of the release directory:
ls -Rlhat $GITHUB_WORKSPACE/release/assets
@@ -713,7 +701,11 @@ jobs:
# Extract the artifact name and create the URL:
artifact_name=$(basename "$sig_file" .sig)
encoded_artifact_name=$(urlencode "$artifact_name")
# Replaces spaces by '.':
encoded_artifact_name=$(echo "$artifact_name" | sed 's/ /./g')
# Create the URL:
url="https://github.com/MindWorkAI/AI-Studio/releases/download/$FORMATTED_VERSION/$encoded_artifact_name"
# Build the JSON object: