0

要求

curl --location --request GET 'https://api.github.com/repos/gittestapi123/DataStructure/pulls/1/files' \

以上 GET API 返回 200 OK

回应

    {
        "sha": "9f4b6d8bfeaf44aaa69872286163784706d1b053",
        "filename": "testFile1",
        "status": "added",
        "additions": 1,
        "deletions": 0,
        "changes": 1,
        "blob_url": "https://github.com/gittestapi123/DataStructure/blob/266f3f884286b84f9d3b50a18e2a2534007a406b/testFile1",
        "raw_url": "https://github.com/gittestapi123/DataStructure/raw/266f3f884286b84f9d3b50a18e2a2534007a406b/testFile1",
        "contents_url": "https://api.github.com/repos/gittestapi123/DataStructure/contents/testFile1?ref=266f3f884286b84f9d3b50a18e2a2534007a406b",
        "patch": "@@ -0,0 +1 @@\n+This is a test file"
    }]

但是对于相同的拉取请求,如果我为GET /repos/{owner}/{repo}/pulls/{pull_number}/merge提交 GET 请求,我会得到 404(即使我包含有效的身份验证标头)

要求

curl --location --request GET 'https://api.github.com/repos/gittestapi123/DataStructure/pulls/1/merge' \

回应

{
    "message": "Not Found",
    "documentation_url": "https://docs.github.com/rest/reference/pulls#check-if-a-pull-request-has-been-merged" }

我想检查拉取请求是否已合并或未使用上述 API。有人请帮忙吗?

提前致谢!

4

1 回答 1

0

您可以看到它没有合并,因为您得到了 404。在您链接到的文档中:

合并拉取请求时的响应

状态:204 无内容

如果未合并拉取请求,则未找到

状态:404 未找到

(强调我的)。

于 2022-01-24T20:10:52.847 回答