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

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 ||