mirror of
https://github.com/securego/gosec.git
synced 2024-11-05 11:35:51 +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() {
|
||||
owner_repo=$1
|
||||
version=$2
|
||||
test -z "$version" && version="latest"
|
||||
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")
|
||||
test -z "$json" && return 1
|
||||
version=$(echo "$json" | tr -s '\n' ' ' | sed 's/.*"tag_name": *"//' | sed 's/".*//')
|
||||
|
|
Loading…
Reference in a new issue