Octokit上是否有一个允许主演回购的原生方法?
一直在寻找客户端。存储库,但找不到任何东西。
答案 0 :(得分:0)
查看您的代码我假设您正在谈论Oktokit.net
文档没有列出独立的API调用,但我能够检测到此功能,并查看源代码:
检查IObservableStarredClient.cs:
/// <summary>
/// Stars a repository for the authenticated user
/// </summary>
/// <param name="owner">The owner of the repository to star</param>
/// <param name="name">The name of the repository to star</param>
/// <returns>A <c>bool</c> representing the success of starring</returns>
IObservable<bool> StarRepo(string owner, string name);
答案 1 :(得分:0)
是的,您可以通过以下方法为存储库加注星标
await client.Activity.Starring.StarRepo(repo.Owner.Login, repo.Name);
该方法将返回bool,指示存储库是否已成功加星标。