如何使用GitHub API查找关闭问题的提交?

问题描述 投票:-2回答:1

问题:我正在寻找一种以编程方式获取关闭GitHub问题的Commit Id(SHA)的方法。我需要为多个GitHub存储库执行此操作,这些存储库存在许多已关闭的问题。

已经做了什么:我试图用Octokit.net library实现这个,但找不到任何可以帮助我的东西(也许我没有找到正确的地方)。 感谢是否有人可以指出我正确的API调用/方法。

github github-api octokit.net
1个回答
0
投票

检查方法Octokit.Tests.Integration/Clients/IssuesClientTests.cs#CanCreateRetrieveAndCloseIssue是否可以帮助您检索和关闭问题。

代码是:

var retrieved = await _issuesClient.Get(_context.RepositoryOwner, _context.RepositoryName, issue.Number);
Assert.NotNull(retrieved);

var closed = _issuesClient.Update(_context.RepositoryOwner, _context.RepositoryName, issue.Number, new IssueUpdate { State = ItemState.Closed }).Result;
Assert.NotNull(closed);
© www.soinside.com 2019 - 2024. All rights reserved.