Fix bug with protocol prefixes

This commit is contained in:
Justin Hutchings
2024-03-06 20:06:26 +00:00
parent 1b21f392ca
commit e878bf8824
3 changed files with 10 additions and 1 deletions

4
dist/index.js generated vendored
View File

@@ -1069,6 +1069,10 @@ function getScorecardLevels(changes) {
const version = change.version;
//Get the project repository
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 (repositoryUrl === null ||
repositoryUrl === undefined ||

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -20,6 +20,11 @@ export async function getScorecardLevels(
//Get the project repository
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 (
repositoryUrl === null ||