Skip to content

Commit

Permalink
check the SHA256 checksum of the installer
Browse files Browse the repository at this point in the history
  • Loading branch information
eine committed Jul 4, 2020
1 parent a2ef8df commit 05abb8d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,13 @@ async function run() {
core.startGroup('Installing MSYS2...');
drive = '%~dp0';
let inst_dest = path.join(tmp_dir, 'base.exe');
const distrib = await tc.downloadTool(
await tc.downloadTool(
'https://github.com/msys2/msys2-installer/releases/download/2020-06-29/msys2-base-x86_64-20200629.sfx.exe',
inst_dest);
if (await exec.exec(`powershell.exe`, [`(Get-FileHash ${inst_dest} -Algorithm SHA256)[0].Hash -eq "5C27950FE639F98B0B73E051C0787F7A08B7D22BCC3BE3ABCB9FA063028827EA"`])) {
core.setFailed(`The SHA256 of the installer does not match!`);
return;
}
await exec.exec(inst_dest, ['-y'], {cwd: dest});
core.endGroup();
}
Expand Down

0 comments on commit 05abb8d

Please sign in to comment.