Skip to content

Commit

Permalink
Plumb failCi into verification function. (#769)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobbieMcKinstry authored Sep 8, 2022
1 parent 7f20bd4 commit 0e9e7b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ try {
}).on('finish', async () => {
filePath.close();

await verify(filename, platform, uploaderVersion, verbose);
await verify(filename, platform, uploaderVersion, verbose, failCi);
await versionInfo(platform, uploaderVersion);
await fs.chmodSync(filename, '777');

Expand Down
7 changes: 4 additions & 3 deletions src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const verify = async (
platform: string,
version: string,
verbose: boolean,
failCi: boolean,
): Promise<void> => {
try {
const uploaderName = getUploaderName(platform);
Expand Down Expand Up @@ -57,7 +58,7 @@ const verify = async (
verified.signatures[0].keyID.toHex(),
);
} else {
setFailure('Codecov: Error validating SHASUM signature', true);
setFailure('Codecov: Error validating SHASUM signature', failCi);
}

const calculateHash = async (filename: string) => {
Expand All @@ -80,11 +81,11 @@ const verify = async (
setFailure(
'Codecov: Uploader shasum does not match -- ' +
`uploader hash: ${hash}, public hash: ${shasum}`,
true,
failCi,
);
}
} catch (err) {
setFailure(`Codecov: Error validating uploader: ${err.message}`, true);
setFailure(`Codecov: Error validating uploader: ${err.message}`, failCi);
}
};
export default verify;

0 comments on commit 0e9e7b4

Please sign in to comment.