- This topic is empty.
-
AuthorPosts
-
September 2, 2024 at 10:02 am #26382
Cheryl
GuestThis is really annoying for scripting purposes, if you pull the Master repo which is the cleanest URL, it might not be a tagged release version.
ex. https://github.com/company/free-software/archive/master.zip
September 2, 2024 at 10:08 am #26383Catherine
GuestTried this in the past, but it didn’t work:
https://gist.github.com/steinwaywhw/a4cd19cda655b8249d908261a62687f8
curl -s https://api.github.com/repos/jgm/pandoc/releases/latest \
| grep "browser_download_url.*deb" \
| cut -d : -f 2,3 \
| tr -d \" \
| wget -qi -September 2, 2024 at 10:11 am #26384Carl
Guest10 years nobody knows.
September 2, 2024 at 10:14 am #26385Amber
Guestit seems to depend on what you are downloading, if it’s a single asset you can use
https://github.com/owner/repository/releases/latest/download/ASSET.ext…. but for the entire repo zip file, I can’t say.
https://stackoverflow.com/questions/24085978/github-url-for-latest-release-of-the-download-file
September 2, 2024 at 10:14 am #26386Catherine
Guest@Amber, seems Reddit agrees?
Download asset from latest release on github
byu/pretty_lame_jokes inlinux4noobsSeptember 2, 2024 at 10:18 am #26387Billy
GuestThat’s the point, it makes no sense.
For a WordPress plugin like:
https://github.com/littlebizzy/plugin-blacklist/releases/latest/download/...The version number changes every time. How to grab the latest plugin zip file URL?
like
https://github.com/littlebizzy/plugin-blacklist/releases/latest.zipseems impossible…
September 2, 2024 at 10:21 am #26388Gary
Guestthis should really not be so complicated lol
September 2, 2024 at 10:34 am #26389Jacob
Guestinterestingly,
https://github.com/littlebizzy/plugin-blacklist/releases/latest/download/latest.zip
will redirect to:
https://github.com/littlebizzy/plugin-blacklist/releases/download/2.0.1/latest.zip
but its a “Not Found” after that.
September 2, 2024 at 10:35 am #26390Ryan
Guestalso:
https://github.com/littlebizzy/plugin-blacklist/archive/latest.zip
will redirect to:
https://codeload.github.com/littlebizzy/plugin-blacklist/zip/latest
and then “404: Not Found”
September 2, 2024 at 10:37 am #26391Theresa
Guesthttps://stackoverflow.com/a/76804894/1718491
a bit heavy but:
echo "fetching latest version"
latest_version=`
curl https://github.com/$owner/$repo/releases/latest --verbose 2>&1 |
grep Location |
sed -e "s|.*/v||"`echo "version: $latest_version"
# if the version number is in the file name, append it
# example:
# file=somefile-$latest_version.extlink="https://github.com/$owner/$repo/releases/download/v$latest_version/$file"
echo "$link"
curl -o "destination/folder/$file" -L "$link"
September 2, 2024 at 10:42 am #26392Judith
Guestphewwww.
September 2, 2024 at 10:43 am #26393Sara
Guestlatest_tag=$(curl -s https://api.github.com/repos/swagger-api/swagger-ui/releases/latest | sed -Ene '/^ *"tag_name": *"(v.+)",$/s//\1/p')
echo "Using version $latest_tag"
curl -JLO https://github.com/swagger-api/swagger-ui/archive/$latest_tag.tar.gzkinda nice approach without needing
jqor weird utilities.September 2, 2024 at 11:16 am #26394Karen
GuestSeptember 2, 2024 at 1:12 pm #26395Danielle
GuestIt’s truly ridiculous that we must parse JSON in the GitHub API for this, instead of them just having some easy 302 redirect or something for every repo on their platform?
September 2, 2024 at 1:29 pm #26396Terry
GuestGITHUB_PLUGIN_BLACKLIST_LATEST_TAG=$(curl -s https://api.github.com/repos/littlebizzy/plugin-blacklist/releases/latest | sed -n 's/.*"tag_name": *"\([^"]*\)".*/\1/p')
GITHUB_PLUGIN_BLACKLIST_DOWNLOAD_URL="https://github.com/littlebizzy/plugin-blacklist/archive/refs/tags/${GITHUB_PLUGIN_BLACKLIST_LATEST_TAG}.zip"and then
ss_wget /tmp/plugin-blacklist.zip "${GITHUB_PLUGIN_BLACKLIST_DOWNLOAD_URL}"Works great for now!
https://github.com/littlebizzy/slickstack/blob/master/bash/ss-functions.txt
https://github.com/littlebizzy/slickstack/blob/master/bash/ss-install-wordpress-mu-plugins.txt
-
AuthorPosts