[英]GitHub API Merge Pull Request (Merge Button) Not Found Response
I'm trying to use the Github Merge Pull Request (Merge Button) but when I call it in either Postman or my app, it gives me a response of 404 Not Found, even though I'm know the :owner
, :repo
and :number
is correct. 我正在尝试使用Github 合并拉取请求(合并按钮),但是当我在邮递员或我的应用中调用它时,即使我知道
:owner
, :repo
和:number
是正确的。
https://api.github.com/repos/:owner/:repo/pulls/:number/merge
Anybody has have this issue? 有人遇到这个问题吗? and how to solve it or correctly call the API endpoint?
以及如何解决或正确调用API端点?
This is my code 这是我的代码
const MergeOpenPR = async (owner, repo, token, number, sha) => {
const url = `${ROOT_API_URL}/repos/${owner}/${repo}/pulls/${number}/merge?access_token=${token}`;
let body;
try {
const res = await fetch(url, {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
sha,
}),
});
body = res.json();
} catch (error) {
throw Error(error);
}
return body;
};
I am not sure if this is the case, as I haven't tried to push anything to my github repo since this morning, but I've read somewhere that GitHub is experiencing some issues and that they've set it to read-only mode, so maybe, although not entirely sure, that causes your problem, since you said you are sure your :owner
, :repo
and :number
are correct. 我不确定是否是这种情况,因为自从今天早上以来我一直没有尝试将任何东西推送到我的github仓库中,但是我读到某个地方GitHub遇到了一些问题,他们已经将其设置为只读模式,因此,尽管不是完全确定,但这可能会导致您的问题,因为您说过您确信
:owner
, :repo
和:number
是正确的。 Maybe try again later or tomorrow. 也许稍后或明天再试一次。
EDIT: Heres a link for GitHub status, currently isn't working properly. 编辑:这是GitHub状态的链接,当前无法正常工作。 https://status.github.com/messages
https://status.github.com/messages
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.