Merge branch 'master' of github.com:spotify/backstage into migrate-to-msw
* 'master' of github.com:spotify/backstage: (34 commits) TechDocs Backend: Replace hardcoded github api by configuration value (#3004) fix: accordion details design for job stage failure (#3014) fix: responsive of page example in storybook (#3005) fix: update the ItemCard component and it's story (#3007) rename stories folder to Chip (#3009) feat: Display the plugins InfoCards on EntityPage Overwiev suitable full height (#2826) fix(cost-insights): More exports to help custom alerting chore(scaffolder): bump rjsf remove unused CSS (#2999) feat: update github pull requests package version fix(github-actions): fix crash when viewing ongoing workflows fix(cli): removePlugin forgotten await catalog-backend: relations db review comments and more tests Feat/add aws lambda plugin (#2985) chore(deps): bump object-path from 0.11.4 to 0.11.5 (#2983) add changeset fix CodeSnippet test case warnings fix CopyTextButton test case warnings fix the warning by wrapping in act fix(catalog): fix link to techdocs ...
This commit is contained in:
@@ -42,9 +42,11 @@ interface IGitlabBranch {
|
||||
};
|
||||
}
|
||||
|
||||
function getGithubApiUrl(url: string): URL {
|
||||
function getGithubApiUrl(config: Config, url: string): URL {
|
||||
const { protocol, owner, name } = parseGitUrl(url);
|
||||
const apiBaseUrl = 'api.github.com';
|
||||
const apiBaseUrl =
|
||||
config.getOptionalString('integrations.github.apiBaseUrl') ||
|
||||
'api.github.com';
|
||||
const apiRepos = 'repos';
|
||||
|
||||
return new URL(`${protocol}://${apiBaseUrl}/${apiRepos}/${owner}/${name}`);
|
||||
@@ -133,7 +135,7 @@ async function getGithubDefaultBranch(
|
||||
repositoryUrl: string,
|
||||
config: Config,
|
||||
): Promise<string> {
|
||||
const path = getGithubApiUrl(repositoryUrl).toString();
|
||||
const path = getGithubApiUrl(config, repositoryUrl).toString();
|
||||
const options = getGithubRequestOptions(config);
|
||||
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user