Is there a way to get the latest tag of a given repo using github API v3

后端 未结 4 722
南笙
南笙 2021-02-02 11:10

I am relatively new to the github api and I am struggling to get the latest tag of a given repo.

Q: Why I need that ?

A:

4条回答
  •  隐瞒了意图╮
    2021-02-02 11:53

    You can get the latest release at https://api.github.com/repos/$org/$repo/releases/latest

    If you want just the tag name, you can try something like this:

    curl https://api.github.com/repos/$org/$repo/releases/latest -s | jq .name -r
    

提交回复
热议问题