可以使用以下命令检查特定问题是否已通过拉取请求、提交或按钮/API 关闭GraphQL API https://docs.github.com/en/free-pro-team@latest/graphql with timelineItems https://docs.github.com/en/free-pro-team@latest/graphql/reference/unions#issuetimelineitems并根据状态过滤事件CLOSED_EVENT
:
{
repository(name: "material-ui", owner: "mui-org") {
issue(number: 19641) {
timelineItems(itemTypes: CLOSED_EVENT, last: 1) {
nodes {
... on ClosedEvent {
createdAt
closer {
__typename
... on PullRequest {
baseRefName
baseRepository {
nameWithOwner
}
headRefName
headRepository {
nameWithOwner
}
}
}
}
}
}
}
}
}
在资源管理器中尝试一下 https://developer.github.com/v4/explorer/?query=%7B%0A%20%20repository%28name%3A%20%22material-ui%22%2C%20owner%3A%20%22mui-org%22%29%20%7B%0A%20%20%20%20issue%28number%3A%2019641%29%20%7B%0A%20%20%20%20%20%20timelineItems%28itemTypes%3A%20CLOSED_EVENT%2C%20last%3A%201%29%20%7B%0A%20%20%20%20%20%20%20%20nodes%20%7B%0A%20%20%20%20%20%20%20%20%20%20...%20on%20ClosedEvent%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20createdAt%0A%20%20%20%20%20%20%20%20%20%20%20%20closer%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20__typename%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20...%20on%20PullRequest%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20baseRefName%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20baseRepository%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20nameWithOwner%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20headRefName%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20headRepository%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20nameWithOwner%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D%0A
The closer
字段包含结束的来源(检查__typename
价值) :
-
通过拉取请求 https://github.blog/2013-05-14-closing-issues-via-pull-requests/:
PullRequest
-
通过提交消息 https://github.blog/2013-01-22-closing-issues-via-commit-messages/:
Commit
- 或通过关闭按钮或 Github API :
null
以下请求是 3 种关闭类型的示例
通过拉取请求关闭
这个拉取请求 https://github.com/mui-org/material-ui/pull/21107 closed 这个问题 https://github.com/mui-org/material-ui/issues/19641
{
repository(name: "material-ui", owner: "mui-org") {
issue(number: 19641) {
timelineItems(itemTypes: CLOSED_EVENT, last: 1) {
nodes {
... on ClosedEvent {
createdAt
closer {
__typename
}
}
}
}
}
}
}
Output
{
"data": {
"repository": {
"issue": {
"timelineItems": {
"nodes": [
{
"createdAt": "2020-05-20T09:06:11Z",
"closer": {
"__typename": "PullRequest"
}
}
]
}
}
}
}
}
通过提交消息关闭
这次提交 https://github.com/rubinius/rubinius/commit/ac420247b365191e1abe62cd8c6ea5847eb417b6 closed 这个问题 https://github.com/rubinius/rubinius/issues/1536
{
repository(name: "rubinius", owner: "rubinius") {
issue(number: 1536) {
timelineItems(itemTypes: CLOSED_EVENT, last: 1) {
nodes {
... on ClosedEvent {
createdAt
closer {
__typename
}
}
}
}
}
}
}
Output
{
"data": {
"repository": {
"issue": {
"timelineItems": {
"nodes": [
{
"createdAt": "2012-01-30T22:33:11Z",
"closer": {
"__typename": "Commit"
}
}
]
}
}
}
}
}
通过按钮或 Github API 关闭
这个问题 https://github.com/rubinius/rubinius/issues/3830通过关闭按钮关闭:
{
repository(name: "rubinius", owner: "rubinius") {
issue(number: 3830) {
timelineItems(itemTypes: CLOSED_EVENT, last: 1) {
nodes {
... on ClosedEvent {
createdAt
closer {
__typename
}
}
}
}
}
}
}
Output
{
"data": {
"repository": {
"issue": {
"timelineItems": {
"nodes": [
{
"createdAt": "2020-02-02T22:31:05Z",
"closer": null
}
]
}
}
}
}
}
Github 应用程序使用 Github API 进行调用以关闭问题,performed_via_github_app
被设置为非null
if you open通过 Github 应用程序生成的 api 调用产生的问题。但performed_via_github_app
没有指定问题是通过哪种方式关闭的: