Add github_tags function to get tags on github
This commit is contained in:
parent
5f5e995fbd
commit
bfcb270cae
@ -76,6 +76,18 @@ github_releases() (
|
||||
"https://api.github.com/repos/${USER}/${REPO}/releases"
|
||||
)
|
||||
|
||||
github_tags() (
|
||||
USER=${1}
|
||||
REPO=${2-}
|
||||
if [ -z "${REPO}" ]; then
|
||||
USER=$(echo "${1}" | sed 's|/| |g' | awk '{print $1}')
|
||||
REPO=$(echo "${1}" | sed 's|/| |g' | awk '{print $2}')
|
||||
fi
|
||||
curl --silent --header "Accept: application/vnd.github.v3+json" \
|
||||
"https://api.github.com/repos/${USER}/${REPO}/tags" |
|
||||
jq -r '.[].name'
|
||||
)
|
||||
|
||||
command_installed() (
|
||||
set -ue
|
||||
cmd=${1}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user