This article describes the method for package download from GitHub release by CLI.
Prerequisite
- GitHub CLI
- unzip command
Steps
# Get the package which is named 'my_package'
PKG_NAME=$(gh release list --limit 100 --order desc --json tagName --jq '[ .[] | select(.tagName | startswith("my_package")) ] | .[0].tagName')
# Download the package
gh release download "$PKG_NAME" --pattern '*.zip' --output "${PKG_NAME}.zip"
# Unpack
unzip "${PKG_NAME}.zip"
Top comments (0)