Skip to content

Instantly share code, notes, and snippets.

@muink
Last active December 6, 2019 11:05
Show Gist options
  • Save muink/f2041123690d0273730a071318cb8b47 to your computer and use it in GitHub Desktop.
Save muink/f2041123690d0273730a071318cb8b47 to your computer and use it in GitHub Desktop.
Get latest GitHub Releases

Get latest GitHub Releases

REPO_URL=jthistle/SUDO/
REPO_URL=brave/brave-browser/

302 response

优雅地从 GitHub 下载 latest releases

curl -s "https://github.com/${REPOS_URL}releases/latest" \
| sed -n "s|.*/releases/tag/\(.*\)\".*|\1|p"

latest version

get_latest_release.sh

curl -s "https://api.github.com/repos/${REPOS_URL}releases/latest" \
| grep '"tag_name":' \
| sed -E 's|.*"([^"]+)".*|\1|'

latest downloads

One Liner to Download the Latest Release from Github Repo.md

curl -s "https://api.github.com/repos/${REPOS_URL}releases/latest" \
| grep "browser_download_url.*-linux-x64\.zip" \
| cut -d: -f2,3 \
| tr -d \"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment