Update .gitea/workflows/ci.yml
This commit is contained in:
@@ -610,11 +610,17 @@ jobs:
|
|||||||
|
|
||||||
sanitize_filename() {
|
sanitize_filename() {
|
||||||
echo "$1" | \
|
echo "$1" | \
|
||||||
sed -e 's#[\\/:\*\?"<>|]#-#g' -e 's#%#_#g' | \
|
tr -d '\r\n' | \
|
||||||
|
sed -e 's#[\\/:\*\?"<>|]#-#g' | \
|
||||||
tr -s ' ' | \
|
tr -s ' ' | \
|
||||||
sed 's/^ *//;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"
|
SKINS_JSON_FILE="${{ github.workspace }}/.gitea/workflows/skins.json"
|
||||||
DESC_FILE=$(mktemp)
|
DESC_FILE=$(mktemp)
|
||||||
|
|
||||||
@@ -660,7 +666,8 @@ jobs:
|
|||||||
}
|
}
|
||||||
fi
|
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 "## [$skin_header]($REGISTRY_URL/$USER_REPOSITORY/media/tag/$new_tag/export/${base_path}.osk)" >> "$README_PATH"
|
||||||
echo "" >> "$README_PATH"
|
echo "" >> "$README_PATH"
|
||||||
|
|
||||||
@@ -671,7 +678,7 @@ jobs:
|
|||||||
author_line=$(grep -i '^[[:space:]]*Author:' "$ini_file" | head -n1 2>/dev/null || true)
|
author_line=$(grep -i '^[[:space:]]*Author:' "$ini_file" | head -n1 2>/dev/null || true)
|
||||||
if [ -n "$author_line" ]; then
|
if [ -n "$author_line" ]; then
|
||||||
author="${author_line#*:}"
|
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"; }
|
[ -n "$author" ] && { echo "**Author:** $author" >> "$README_PATH"; echo "" >> "$README_PATH"; }
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -709,7 +716,8 @@ jobs:
|
|||||||
}
|
}
|
||||||
fi
|
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 "## [$skin_header]($REGISTRY_URL/$USER_REPOSITORY/media/tag/$new_tag/export/${base_path}.osk)" >> "$README_PATH"
|
||||||
echo "" >> "$README_PATH"
|
echo "" >> "$README_PATH"
|
||||||
|
|
||||||
@@ -717,7 +725,7 @@ jobs:
|
|||||||
author_line=$(grep -i '^[[:space:]]*Author:' "$ini_file" | head -n1 2>/dev/null || true)
|
author_line=$(grep -i '^[[:space:]]*Author:' "$ini_file" | head -n1 2>/dev/null || true)
|
||||||
if [ -n "$author_line" ]; then
|
if [ -n "$author_line" ]; then
|
||||||
author="${author_line#*:}"
|
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"; }
|
[ -n "$author" ] && { echo "**Author:** $author" >> "$README_PATH"; echo "" >> "$README_PATH"; }
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user