簡體   English   中英

找不到GitHub API合並拉取請求(合並按鈕)響應

[英]GitHub API Merge Pull Request (Merge Button) Not Found Response

我正在嘗試使用Github 合並拉取請求(合並按鈕),但是當我在郵遞員或我的應用中調用它時,即使我知道:owner:repo:number是正確的。

https://api.github.com/repos/:owner/:repo/pulls/:number/merge

有人遇到這個問題嗎? 以及如何解決或正確調用API端點?

這是我的代碼

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;
};

我不確定是否是這種情況,因為自從今天早上以來我一直沒有嘗試將任何東西推送到我的github倉庫中,但是我讀到某個地方GitHub遇到了一些問題,他們已經將其設置為只讀模式,因此,盡管不是完全確定,但這可能會導致您的問題,因為您說過您確信:owner:repo:number是正確的。 也許稍后或明天再試一次。

編輯:這是GitHub狀態的鏈接,當前無法正常工作。 https://status.github.com/messages

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM