DEV Community

Tomoyuki KOYAMA
Tomoyuki KOYAMA

Posted on

Download package from GitHub release

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"
Enter fullscreen mode Exit fullscreen mode

Top comments (0)