Skip to content

Commit

Permalink
Resolve some sonarlint improvements suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
marcofranssen committed Sep 23, 2024
1 parent a907b72 commit d34f2b5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions lib/setup-iamlive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async function downloadCLI(
const pathToCLIArchive = await tc.downloadTool(url);
core.debug(`iamlive CLI archive downloaded to ${pathToCLIArchive}`);

if (!verifyChecksum(pathToCLIArchive, checksums[version])) {
if (!(await verifyChecksum(pathToCLIArchive, checksums[version]))) {
throw new Error(`Checksum didn't match: ${checksums[version]}.`);
}

Expand All @@ -129,6 +129,6 @@ async function verifyChecksum(
const rs = await readFile(download);
const digest = createHash("sha256").update(rs).digest("hex");
const grepChecksum = new RegExp(`.*${download.split("/").pop()}$/gm`);
const matches = checksums.match(grepChecksum);
const matches = grepChecksum.exec(checksums);
return matches?.[0] === digest;
}

0 comments on commit d34f2b5

Please sign in to comment.