Skip to content

Commit

Permalink
Only log checksum is valid when it really is (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
eifinger authored Sep 21, 2024
1 parent abac0ce commit 8c3a35e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
8 changes: 5 additions & 3 deletions dist/setup/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions src/download/checksum/checksum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export async function validateChecksum(
platform: Platform,
version: string,
): Promise<void> {
let isValid = true;
let isValid: boolean | undefined = undefined;
if (checkSum !== undefined && checkSum !== "") {
isValid = await validateFileCheckSum(downloadPath, checkSum);
} else {
Expand All @@ -27,10 +27,12 @@ export async function validateChecksum(
}
}

if (!isValid) {
if (isValid === false) {
throw new Error(`Checksum for ${downloadPath} did not match ${checkSum}.`);
}
core.debug(`Checksum for ${downloadPath} is valid.`);
if (isValid === true) {
core.debug(`Checksum for ${downloadPath} is valid.`);
}
}

async function validateFileCheckSum(
Expand Down

0 comments on commit 8c3a35e

Please sign in to comment.