mirror of
https://github.com/securego/gosec.git
synced 2024-12-24 11:35:52 +00:00
Fix github latest URL (#918)
This commit is contained in:
parent
e85e1a7234
commit
9432e676a8
1 changed files with 3 additions and 1 deletions
|
@ -280,8 +280,10 @@ http_copy() {
|
||||||
github_release() {
|
github_release() {
|
||||||
owner_repo=$1
|
owner_repo=$1
|
||||||
version=$2
|
version=$2
|
||||||
test -z "$version" && version="latest"
|
|
||||||
giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
|
giturl="https://api.github.com/repos/${owner_repo}/releases/tags/${version}"
|
||||||
|
if [ -z "${version}" ]; then
|
||||||
|
giturl="https://api.github.com/repos/${owner_repo}/releases/latest"
|
||||||
|
fi
|
||||||
json=$(http_copy "$giturl" "Accept:application/json")
|
json=$(http_copy "$giturl" "Accept:application/json")
|
||||||
test -z "$json" && return 1
|
test -z "$json" && return 1
|
||||||
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
|
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
|
||||||
|
|
Loading…
Reference in a new issue