Skip to content

Commit 8c3a35e

Browse files
authored
Only log checksum is valid when it really is (#97)
1 parent abac0ce commit 8c3a35e

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

dist/setup/index.js

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/download/checksum/checksum.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function validateChecksum(
1212
platform: Platform,
1313
version: string,
1414
): Promise<void> {
15-
let isValid = true;
15+
let isValid: boolean | undefined = undefined;
1616
if (checkSum !== undefined && checkSum !== "") {
1717
isValid = await validateFileCheckSum(downloadPath, checkSum);
1818
} else {
@@ -27,10 +27,12 @@ export async function validateChecksum(
2727
}
2828
}
2929

30-
if (!isValid) {
30+
if (isValid === false) {
3131
throw new Error(`Checksum for ${downloadPath} did not match ${checkSum}.`);
3232
}
33-
core.debug(`Checksum for ${downloadPath} is valid.`);
33+
if (isValid === true) {
34+
core.debug(`Checksum for ${downloadPath} is valid.`);
35+
}
3436
}
3537

3638
async function validateFileCheckSum(

0 commit comments

Comments
 (0)