-1
  1. https://api.github.com/repos/WordPress/WordPress/releases/latest doesn't seem to work, so we are out of luck

  2. using xpath package (specifically wget -qO- https://wordpress.org/download/releases/ | xpath -e '//table[contains(@class,'latest')]/tbody/tr/td[1]' ) won't work, because the https://wordpress.org/download/releases/ is not really valid HTML page and writing bash workarounds for the official site seems like an overkill

  3. svn log https://core.svn.wordpress.org/tags --limit 1 | grep 'Tag' Is a way that works, but there's no chance this will always show latest stable tag.

Do you maybe have any other ideas that are reliable to get the latest stable release?

Expected value I'm looking for (at the time of writing this post):

5.2

EDIT: someone marked the question as duplicate,but one of the answers cleared that out. The Wordpress github repository does NOT have releases, and latest stable release cannot be fetched using github API. /tags will show ALL tags, and I'm only interested in stable ones.

oguz ismail
  • 1
  • 16
  • 47
  • 69
Jan Myszkier
  • 2,714
  • 1
  • 16
  • 23

1 Answers1

1

Quoting from this answer:

GitHub's UI is confusing, but this repository doesn't actually have any releases, which are a GitHub-specific concept. The "releases" you are seeing are actually just regular Git tags.

You've faced the same issue. You need to request tags instead of releases from the api and it will work that way. E.g:

curl -sS 'https://api.github.com/repos/WordPress/WordPress/tags' |
jq -r '.[0].name'

This shows 5.2 to me.

oguz ismail
  • 1
  • 16
  • 47
  • 69
  • This is pretty much what I've tried with example 3, and there's no guarantee to get the latest stable tag when the most recently added tag is 6.0-rc1 or so. I just want to get latest stable release from some source we can trust and tag list is not one of them, unfortunately. – Jan Myszkier May 14 '19 at 07:47
  • okay then, good luck – oguz ismail May 14 '19 at 07:48