Fix build breaks

This commit is contained in:
Justin Hutchings
2024-03-03 00:15:42 +00:00
parent 3d70a3cf05
commit f419e37c19
2 changed files with 9 additions and 8 deletions

View File

@@ -110,7 +110,8 @@ async function run(): Promise<void> {
}
)
core.debug(await getScorecardLevels(filteredChanges))
const scorecard = await getScorecardLevels(filteredChanges)
core.debug(`Scorecard: ${JSON.stringify(scorecard)}`)
core.debug(`Filtered Changes: ${JSON.stringify(filteredChanges)}`)
core.debug(`Config Deny Packages: ${JSON.stringify(config)}`)

View File

@@ -20,25 +20,25 @@ export async function getScorecardLevels(changes: Change[]): Promise<any> {
changes.forEach((change) => {
const purl = PackageURL.fromString(change.package_url)
const ecosystem = purl.type
const package = purl.name
const packageName = purl.name
const version = purl.version
return getDepsDevData(ecosystem, package, String(version));
}
return getDepsDevData(ecosystem, packageName, String(version));
});
}
const depsDevAPIRoot = 'https://api.deps.dev'
async function getDepsDevData(ecosystem: String, package: String, version: String): Promise<any> {
async function getDepsDevData(ecosystem: String, packageName: String, version: String): Promise<any> {
//Query deps.dev GetVersion API
const url = `${depsDevAPIRoot}//v3alpha/systems/${ecosystem}/packages/${package}/versions/${version}`;
const url = `${depsDevAPIRoot}//v3alpha/systems/${ecosystem}/packages/${packageName}/versions/${version}`;
const response = await fetch(url);
const data = await response.json();
//Get the related projects
const projects = data.relatedProjects;
projects.forEach((project) => {
projects.forEach((project: any) => {
return getDepsDevProjectData(project.projectKey);
}
})
}
async function getDepsDevProjectData(projectKey: String): Promise<DepsDevProject> {