Update .gitea/workflows/ci.yml

This commit is contained in:
Arlind
2025-06-16 10:10:15 +02:00
parent 1a1d073bf6
commit 7b4dea4e3e

View File

@@ -610,11 +610,17 @@ jobs:
sanitize_filename() {
echo "$1" | \
sed -e 's#[\\/:\*\?"<>|]#-#g' -e 's#%#_#g' | \
tr -d '\r\n' | \
sed -e 's#[\\/:\*\?"<>|]#-#g' | \
tr -s ' ' | \
sed 's/^ *//;s/ *$//'
}
url_encode_path() {
local raw_path="$1"
echo "$raw_path" | tr -d '\r\n' | jq -sRr @uri
}
SKINS_JSON_FILE="${{ github.workspace }}/.gitea/workflows/skins.json"
DESC_FILE=$(mktemp)
@@ -660,7 +666,8 @@ jobs:
}
fi
base_path=$(printf "%s/%s" "$skin" "$skin_header" | sed 's/ /%20/g')
raw_path="$(printf "%s/%s" "$skin" "$skin_header" | sed 's/^ *//;s/ *$//')"
base_path=$(url_encode_path "$raw_path")
echo "## [$skin_header]($REGISTRY_URL/$USER_REPOSITORY/media/tag/$new_tag/export/${base_path}.osk)" >> "$README_PATH"
echo "" >> "$README_PATH"
@@ -671,7 +678,7 @@ jobs:
author_line=$(grep -i '^[[:space:]]*Author:' "$ini_file" | head -n1 2>/dev/null || true)
if [ -n "$author_line" ]; then
author="${author_line#*:}"
author="$(echo "$author" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
author="$(sanitize_filename "$author")"
[ -n "$author" ] && { echo "**Author:** $author" >> "$README_PATH"; echo "" >> "$README_PATH"; }
fi
fi
@@ -709,7 +716,8 @@ jobs:
}
fi
base_path=$(printf "%s/%s" "$skin" "$skin_header" | sed 's/ /%20/g')
raw_path="$(printf "%s/%s" "$skin" "$skin_header" | sed 's/^ *//;s/ *$//')"
base_path=$(url_encode_path "$raw_path")
echo "## [$skin_header]($REGISTRY_URL/$USER_REPOSITORY/media/tag/$new_tag/export/${base_path}.osk)" >> "$README_PATH"
echo "" >> "$README_PATH"
@@ -717,7 +725,7 @@ jobs:
author_line=$(grep -i '^[[:space:]]*Author:' "$ini_file" | head -n1 2>/dev/null || true)
if [ -n "$author_line" ]; then
author="${author_line#*:}"
author="$(echo "$author" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')"
author="$(sanitize_filename "$author")"
[ -n "$author" ] && { echo "**Author:** $author" >> "$README_PATH"; echo "" >> "$README_PATH"; }
fi
fi