Bash script to check for latest released version

I’m trying to find somewhere to capture the latest version released via bash script

So I can then compare it to

grep VERSION_ID /etc/os-release

Github api seems the obvious place but I’m note sure if my query is incorrect or it’s got something to do with the latest release being marked differently

curl -s https://api.github.com/repos/osmc/osmc/releases/latest
{
  "message": "Not Found",
  "documentation_url": "https://developer.github.com/v3/repos/releases/#get-the-latest-release"
}

compare with:

curl -s https://api.github.com/repos/jgm/pandoc/releases/latest # grep tag_name

I’m not tied to using github is there’s another/ better reliable location?

Reason:
I’ve a few pis running at remote locations for family members and I appreciate I can just cron dist-upgrade but I want to control the version updates as I’m using mysql.

Suspect I’m being really stupid here so thanks for bearing with me

You can try comparing the os-release file with the version on git here:

https://raw.githubusercontent.com/osmc/osmc/master/package/base-files-osmc/files/etc/os-release

Perfect, thank you!

Just in case it’s useful for anyone else (and always happy to take suggestions as it’s new to me)

#!/bin/bash
localversion=$(grep VERSION_ID /etc/os-release |  grep -o '".*"' | sed 's/"//g')
remoteversion=$(curl -s https://raw.githubusercontent.com/osmc/osmc/master/package/base-files-osmc/files/etc/os-release |  grep VERSION_ID |  grep -o '".*"' | sed 's/"//g')
if [ "$remoteversion" = "$localversion" ]
then
echo same version - nothing to do
else
echo versions difference - do something
fi