要求
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。有人请帮忙吗?
提前致谢!