From 8c3a35e468411fbdfb59064e533e71255a86f87b Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 21 Sep 2024 21:10:22 +0200 Subject: [PATCH] Only log checksum is valid when it really is (#97) --- dist/setup/index.js | Bin 3767630 -> 3767690 bytes src/download/checksum/checksum.ts | 8 +++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/setup/index.js b/dist/setup/index.js index e5498b81a08f11e2de92f001353587a8e7985790..151a2b9e44b39c0d5a0fc663cf91c38e4cbb9c51 100644 GIT binary patch delta 239 zcmX}ht4_mE9Khjpbf;|G##(OWvX!;KE^x-Uqu>R=ElV&ZL9hgeCYkspOQuLFjzv$* zKr)NL@&aHGle_>J{tEG_@BL?F^?pZI2a6PA*rZW7jFTbD1d~iL%?vqa$>ZWN$2BYq2e7(sEDz^kVr8J6-!U?CMJZAVlF~5H?Sn} z5FEf(8owubR)@W@``a5!41D+r5afsuVIo9{VRFm~aS|j+ktRcy9C=PTqd<{!F1X~1 z5{fbvs#w&h)1XO{v)8wJFK_=6wLlgC diff --git a/src/download/checksum/checksum.ts b/src/download/checksum/checksum.ts index 3a9e063..29d5857 100644 --- a/src/download/checksum/checksum.ts +++ b/src/download/checksum/checksum.ts @@ -12,7 +12,7 @@ export async function validateChecksum( platform: Platform, version: string, ): Promise { - let isValid = true; + let isValid: boolean | undefined = undefined; if (checkSum !== undefined && checkSum !== "") { isValid = await validateFileCheckSum(downloadPath, checkSum); } else { @@ -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(