github获取最新release api


获取json

https://api.github.com/repos/{项目名称}/releases/latest

实例 我的垃圾项目名称kingchun/socks5-install-for-gost

https://api.github.com/repos/kingchun/socks5-install-for-gost/releases/latest

就会获取到一个json大概这样

{
  "url": "https://api.github.com/repos/kingchun/socks5-install-for-gost/releases/47907203",
  "assets_url": "https://api.github.com/repos/kingchun/socks5-install-for-gost/releases/47907203/assets",
  "upload_url": "https://uploads.github.com/repos/kingchun/socks5-install-for-gost/releases/47907203/assets{?name,label}",
  "html_url": "https://github.com/kingchun/socks5-install-for-gost/releases/tag/1.0",
  "id": 47907203,
  "author": {
    "login": "kingchun",
    "id": 48005341,
    "node_id": "MDQ6VXNlcjQ4MDA1MzQx",
    "avatar_url": "https://avatars.githubusercontent.com/u/48005341?v=4",
    "gravatar_id": "",
    "url": "https://api.github.com/users/kingchun",
    "html_url": "https://github.com/kingchun",
    "followers_url": "https://api.github.com/users/kingchun/followers",
    "following_url": "https://api.github.com/users/kingchun/following{/other_user}",
    "gists_url": "https://api.github.com/users/kingchun/gists{/gist_id}",
    "starred_url": "https://api.github.com/users/kingchun/starred{/owner}{/repo}",
    "subscriptions_url": "https://api.github.com/users/kingchun/subscriptions",
    "organizations_url": "https://api.github.com/users/kingchun/orgs",
    "repos_url": "https://api.github.com/users/kingchun/repos",
    "events_url": "https://api.github.com/users/kingchun/events{/privacy}",
    "received_events_url": "https://api.github.com/users/kingchun/received_events",
    "type": "User",
    "site_admin": false
  },
  "node_id": "MDc6UmVsZWFzZTQ3OTA3MjAz",
  "tag_name": "1.0",
  "target_commitish": "main",
  "name": "",
  "draft": false,
  "prerelease": false,
  "created_at": "2021-08-16T12:48:57Z",
  "published_at": "2021-08-16T12:49:44Z",
  "assets": [

  ],
  "tarball_url": "https://api.github.com/repos/kingchun/socks5-install-for-gost/tarball/1.0",
  "zipball_url": "https://api.github.com/repos/kingchun/socks5-install-for-gost/zipball/1.0",
  "body": ""
}

linux建议用jq去解析数据 一个命令行解析json的软件

声明:小小博客|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - github获取最新release api


Carpe Diem and Do what I like