GitHub API - 用于更改文件权限
GitHub API - for changing file permissions
是否有使用 GitHub API (v3) 更改文件权限的明确方法。这是一个罕见的用例,但我们有一个理由。我们找不到一个,任何指示都会有所帮助。
谢谢
虽然 V3 API has ways to update a file,但似乎没有办法以简单的方式更改其权限。
文件权限存储在树对象(基本上是目录)中,V3 allows you direct access to the underlying objects. You can, conceivably, get the tree object holding the correct blob (file) and replace it with a new tree object with your changed permissions。
Github 也引入了新的 V4 GraphQL API which has more extensive access to the repository, but requires understanding GraphQL. Again you can find the correct Tree and TreeEntry 并使用新模式创建新的 Tree 和 TreeEntry。
虽然 GraphQL 非常强大并且值得学习,但如果您要使用 Github API 做很多工作,那么克隆 repo 并执行它可能会更简单Git.
是否有使用 GitHub API (v3) 更改文件权限的明确方法。这是一个罕见的用例,但我们有一个理由。我们找不到一个,任何指示都会有所帮助。
谢谢
虽然 V3 API has ways to update a file,但似乎没有办法以简单的方式更改其权限。
文件权限存储在树对象(基本上是目录)中,V3 allows you direct access to the underlying objects. You can, conceivably, get the tree object holding the correct blob (file) and replace it with a new tree object with your changed permissions。
Github 也引入了新的 V4 GraphQL API which has more extensive access to the repository, but requires understanding GraphQL. Again you can find the correct Tree and TreeEntry 并使用新模式创建新的 Tree 和 TreeEntry。
虽然 GraphQL 非常强大并且值得学习,但如果您要使用 Github API 做很多工作,那么克隆 repo 并执行它可能会更简单Git.