获取GitHub分支保护返回“404未找到”

3
我试过使用curl / Postman获取分支策略,但是我一直收到错误“404未找到”。 {{link1:enter image description here}}
根据文档(https://docs.github.com/en/rest/reference/repos#get-branch-protection),我似乎正在使用正确的API Uri。请参见下面使用的命令。 PS:已验证身份验证令牌。
对于Curl:
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调用来返回分支保护。谢谢!
1个回答

5

尽管当前没有明确的文档说明,但是此API URI要求提供的访问令牌需要对该代码库拥有管理员权限。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接