Fix bug with protocol prefixes
This commit is contained in:
+4
@@ -1069,6 +1069,10 @@ function getScorecardLevels(changes) {
|
|||||||
const version = change.version;
|
const version = change.version;
|
||||||
//Get the project repository
|
//Get the project repository
|
||||||
let repositoryUrl = change.source_repository_url;
|
let repositoryUrl = change.source_repository_url;
|
||||||
|
//If the repository_url includes the protocol, remove it
|
||||||
|
if (repositoryUrl === null || repositoryUrl === void 0 ? void 0 : repositoryUrl.startsWith('https://')) {
|
||||||
|
repositoryUrl = repositoryUrl.replace('https://', '');
|
||||||
|
}
|
||||||
// If GitHub API doesn't have the repository URL, query deps.dev for it.
|
// If GitHub API doesn't have the repository URL, query deps.dev for it.
|
||||||
if (repositoryUrl === null ||
|
if (repositoryUrl === null ||
|
||||||
repositoryUrl === undefined ||
|
repositoryUrl === undefined ||
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -20,6 +20,11 @@ export async function getScorecardLevels(
|
|||||||
|
|
||||||
//Get the project repository
|
//Get the project repository
|
||||||
let repositoryUrl = change.source_repository_url
|
let repositoryUrl = change.source_repository_url
|
||||||
|
//If the repository_url includes the protocol, remove it
|
||||||
|
if (repositoryUrl?.startsWith('https://')) {
|
||||||
|
repositoryUrl = repositoryUrl.replace('https://', '')
|
||||||
|
}
|
||||||
|
|
||||||
// If GitHub API doesn't have the repository URL, query deps.dev for it.
|
// If GitHub API doesn't have the repository URL, query deps.dev for it.
|
||||||
if (
|
if (
|
||||||
repositoryUrl === null ||
|
repositoryUrl === null ||
|
||||||
|
|||||||
Reference in New Issue
Block a user