0

我有一个小项目用于更新 GitHub 存储库中的各种设置。虽然我找到了 repo,但 Edit 方法会抛出 NotFoundException。有什么建议可能是错的吗?我正在从“大师”变为“开发”,两者都存在。

public async Task<Repository> SetDefaultBranch(string repository, string branch)
{
   //var repo = await _client.Repository.Get(_owner, update.Name);
   // the repo is found, but afterwards I receive NotFoundException on Edit

   var update = new RepositoryUpdate(repository) { DefaultBranch = branch };
   return await _client.Repository.Edit(_owner, repository, update);
}
4

1 回答 1

0

你必须检查你是否有权限(像往常一样)。如果导航面包屑中没有“设置”,则您没有权限。

为什么 Octokit.net 返回NotFoundException,而不是AuthorizationException另一个故事。

于 2020-01-20T14:49:33.937 回答