update get_github_package_download_url helper (#5051)

This commit is contained in:
Dibir Magomedsaygitov
2022-02-09 15:52:28 +03:00
committed by GitHub
parent a9fba6b110
commit 52011e5c44
4 changed files with 8 additions and 9 deletions

View File

@@ -173,16 +173,15 @@ configure_user_tccdb () {
}
get_github_package_download_url() {
local REPO_OWNER=$1
local REPO_NAME=$2
local FILTER=$3
local VERSION=$4
local API_PAT=$5
local REPO_ORG=$1
local FILTER=$2
local VERSION=$3
local API_PAT=$4
local SEARCH_IN_COUNT="100"
[ -n "$API_PAT" ] && authString=(-H "Authorization: token ${API_PAT}")
json=$(curl "${authString[@]}" -s "https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases?per_page=${SEARCH_IN_COUNT}")
json=$(curl "${authString[@]}" -s "https://api.github.com/repos/${REPO_ORG}/releases?per_page=${SEARCH_IN_COUNT}")
if [[ "$VERSION" == "latest" ]]; then
tagName=$(echo $json | jq -r '.[] | select(.prerelease==false).tag_name' | sort --unique --version-sort | egrep -v ".*-[a-z]" | tail -1)