mirror of
https://github.com/kiegroup/git-backporting.git
synced 2025-05-10 18:53:43 +00:00
fix(issue-52): use pull request github api url as source (#53)
fix https://github.com/kiegroup/git-backporting/issues/52
This commit is contained in:
parent
fcc01673f4
commit
a737aa7c4c
9 changed files with 231 additions and 5 deletions
2
dist/cli/index.js
vendored
2
dist/cli/index.js
vendored
|
@ -560,7 +560,7 @@ exports.inferGitClient = inferGitClient;
|
|||
const inferGitApiUrl = (prUrl, apiVersion = "v4") => {
|
||||
const url = new URL(prUrl);
|
||||
const baseUrl = `${url.protocol}//${url.host}`;
|
||||
if (baseUrl.includes(PUBLIC_GITHUB_URL)) {
|
||||
if (baseUrl.includes(PUBLIC_GITHUB_URL) || baseUrl.includes(PUBLIC_GITHUB_API)) {
|
||||
return PUBLIC_GITHUB_API;
|
||||
}
|
||||
return `${baseUrl}/api/${apiVersion}`;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue