Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plumb failCi into verification function. #769

Merged
merged 1 commit into from Sep 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/index.ts
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
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;