Skip to content
Snippets Groups Projects
Unverified Commit a5c1692d authored by Rhys Arkins's avatar Rhys Arkins Committed by GitHub
Browse files

fix(github): apiBaseUrl for changelogs should append api/v3/ (#6325)

parent df96e524
No related branches found
No related tags found
No related merge requests found
...@@ -159,7 +159,7 @@ exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and gi ...@@ -159,7 +159,7 @@ exports[`workers/pr/changelog getChangeLogJSON supports github enterprise and gi
Object { Object {
"hasReleaseNotes": true, "hasReleaseNotes": true,
"project": Object { "project": Object {
"apiBaseUrl": "https://github-enterprise.example.com/", "apiBaseUrl": "https://github-enterprise.example.com/api/v3/",
"baseUrl": "https://github-enterprise.example.com/", "baseUrl": "https://github-enterprise.example.com/",
"depName": "renovate", "depName": "renovate",
"github": "chalk/chalk", "github": "chalk/chalk",
...@@ -217,7 +217,7 @@ Array [ ...@@ -217,7 +217,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/tags?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/tags?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -228,7 +228,7 @@ Array [ ...@@ -228,7 +228,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -239,7 +239,7 @@ Array [ ...@@ -239,7 +239,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -250,7 +250,7 @@ Array [ ...@@ -250,7 +250,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -261,7 +261,7 @@ Array [ ...@@ -261,7 +261,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -272,7 +272,7 @@ Array [ ...@@ -272,7 +272,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -283,7 +283,7 @@ Array [ ...@@ -283,7 +283,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -294,7 +294,7 @@ Array [ ...@@ -294,7 +294,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -305,7 +305,7 @@ Array [ ...@@ -305,7 +305,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
] ]
`; `;
...@@ -469,7 +469,7 @@ exports[`workers/pr/changelog getChangeLogJSON supports github.com and github en ...@@ -469,7 +469,7 @@ exports[`workers/pr/changelog getChangeLogJSON supports github.com and github en
Object { Object {
"hasReleaseNotes": true, "hasReleaseNotes": true,
"project": Object { "project": Object {
"apiBaseUrl": "https://github-enterprise.example.com/", "apiBaseUrl": "https://github-enterprise.example.com/api/v3/",
"baseUrl": "https://github-enterprise.example.com/", "baseUrl": "https://github-enterprise.example.com/",
"depName": "renovate", "depName": "renovate",
"github": "chalk/chalk", "github": "chalk/chalk",
...@@ -527,7 +527,7 @@ Array [ ...@@ -527,7 +527,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/tags?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/tags?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -538,7 +538,7 @@ Array [ ...@@ -538,7 +538,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -549,7 +549,7 @@ Array [ ...@@ -549,7 +549,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -560,7 +560,7 @@ Array [ ...@@ -560,7 +560,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -571,7 +571,7 @@ Array [ ...@@ -571,7 +571,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -582,7 +582,7 @@ Array [ ...@@ -582,7 +582,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -593,7 +593,7 @@ Array [ ...@@ -593,7 +593,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -604,7 +604,7 @@ Array [ ...@@ -604,7 +604,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/contents/", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/contents/",
}, },
Object { Object {
"headers": Object { "headers": Object {
...@@ -615,7 +615,7 @@ Array [ ...@@ -615,7 +615,7 @@ Array [
"user-agent": "https://github.com/renovatebot/renovate", "user-agent": "https://github.com/renovatebot/renovate",
}, },
"method": "GET", "method": "GET",
"url": "https://github-enterprise.example.com/repos/chalk/chalk/releases?per_page=100", "url": "https://github-enterprise.example.com/api/v3/repos/chalk/chalk/releases?per_page=100",
}, },
] ]
`; `;
......
...@@ -81,7 +81,7 @@ export async function getChangeLogJSON({ ...@@ -81,7 +81,7 @@ export async function getChangeLogJSON({
} }
const apiBaseUrl = sourceUrl.startsWith('https://github.com/') const apiBaseUrl = sourceUrl.startsWith('https://github.com/')
? 'https://api.github.com/' ? 'https://api.github.com/'
: baseUrl; : baseUrl + 'api/v3/';
const repository = pathname.slice(1).replace(/\/$/, ''); const repository = pathname.slice(1).replace(/\/$/, '');
if (repository.split('/').length !== 2) { if (repository.split('/').length !== 2) {
logger.debug({ sourceUrl }, 'Invalid github URL found'); logger.debug({ sourceUrl }, 'Invalid github URL found');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment