Skip to content

Instantly share code, notes, and snippets.

@skanga
Created July 20, 2017 21:52
Show Gist options
  • Save skanga/f731b723e69e209b16c9a8ebd460177e to your computer and use it in GitHub Desktop.
Save skanga/f731b723e69e209b16c9a8ebd460177e to your computer and use it in GitHub Desktop.
# Download latest release of a specific file from a Github repo
REPO_OWNER='PowerShell'
REPO_NAME='Win32-OpenSSH'
ARTIFACT_NAME=OpenSSH-Win64.zip
ARTIFACT_URL=$(curl -sL https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/releases/latest | jq --raw-output '.assets[] | .browser_download_url' | grep ${ARTIFACT_NAME})
curl -sLO $ARTIFACT_URL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment