【问题标题】:Getting GitHub Branch protection returns "404 Not Found"获取 GitHub 分支保护返回“404 Not Found”
【发布时间】:2021-11-19 13:48:53
【问题描述】:

我尝试使用 curl / Postman 获取分支策略,但是我不断收到错误“404 Not Found”。

根据文档 (https://docs.github.com/en/rest/reference/repos#get-branch-protection),我似乎使用了正确的 API Uri。请参阅下面使用的命令。 Ps:Auth Token 已经通过验证。

对于卷曲:

curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/{owner}/{repo}/branches/{branch}/protection

邮递员:

https://api.github.com/repos/{owner}/{repo}/branches/{branch}/protection

我需要 API 调用来返回分支保护。谢谢!

【问题讨论】:

    标签: api rest github curl postman


    【解决方案1】:

    虽然目前没有明确记录, 此 API URI 需要提供的访问令牌才能拥有存储库的管理员权限。

    【讨论】:

      猜你喜欢
      • 2015-05-10
      • 2016-03-16
      • 2021-06-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-01
      相关资源
      最近更新 更多