Fix scorecard bug

This commit is contained in:
Justin Hutchings
2024-03-06 19:44:54 +00:00
parent 111227a118
commit 1b21f392ca
3 changed files with 8 additions and 3 deletions

5
dist/index.js generated vendored
View File

@@ -1103,11 +1103,14 @@ function getScorecard(repositoryUrl) {
return __awaiter(this, void 0, void 0, function* () {
const apiRoot = 'https://api.securityscorecards.dev/';
let scorecardResponse = {};
const url = `${apiRoot}/${repositoryUrl}`;
const url = `${apiRoot}/projects/${repositoryUrl}`;
const response = yield fetch(url);
if (response.ok) {
scorecardResponse = yield response.json();
}
else {
core.debug(`Couldn't get scorecard data for ${repositoryUrl}`);
}
return scorecardResponse;
});
}

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -57,10 +57,12 @@ async function getScorecard(repositoryUrl: string): Promise<ScorecardApi> {
const apiRoot = 'https://api.securityscorecards.dev/'
let scorecardResponse: ScorecardApi = {} as ScorecardApi
const url = `${apiRoot}/${repositoryUrl}`
const url = `${apiRoot}/projects/${repositoryUrl}`
const response = await fetch(url)
if (response.ok) {
scorecardResponse = await response.json()
} else {
core.debug(`Couldn't get scorecard data for ${repositoryUrl}`)
}
return scorecardResponse
}