Plumb failCi into verification function. (#769)

This commit is contained in:
Robbie McKinstry 2022-09-08 13:32:36 -04:00 committed by GitHub
parent 7f20bd4c41
commit 0e9e7b4e8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -35,7 +35,7 @@ try {
}).on('finish', async () => { }).on('finish', async () => {
filePath.close(); filePath.close();
await verify(filename, platform, uploaderVersion, verbose); await verify(filename, platform, uploaderVersion, verbose, failCi);
await versionInfo(platform, uploaderVersion); await versionInfo(platform, uploaderVersion);
await fs.chmodSync(filename, '777'); await fs.chmodSync(filename, '777');

View file

@ -17,6 +17,7 @@ const verify = async (
platform: string, platform: string,
version: string, version: string,
verbose: boolean, verbose: boolean,
failCi: boolean,
): Promise<void> => { ): Promise<void> => {
try { try {
const uploaderName = getUploaderName(platform); const uploaderName = getUploaderName(platform);
@ -57,7 +58,7 @@ const verify = async (
verified.signatures[0].keyID.toHex(), verified.signatures[0].keyID.toHex(),
); );
} else { } else {
setFailure('Codecov: Error validating SHASUM signature', true); setFailure('Codecov: Error validating SHASUM signature', failCi);
} }
const calculateHash = async (filename: string) => { const calculateHash = async (filename: string) => {
@ -80,11 +81,11 @@ const verify = async (
setFailure( setFailure(
'Codecov: Uploader shasum does not match -- ' + 'Codecov: Uploader shasum does not match -- ' +
`uploader hash: ${hash}, public hash: ${shasum}`, `uploader hash: ${hash}, public hash: ${shasum}`,
true, failCi,
); );
} }
} catch (err) { } catch (err) {
setFailure(`Codecov: Error validating uploader: ${err.message}`, true); setFailure(`Codecov: Error validating uploader: ${err.message}`, failCi);
} }
}; };
export default verify; export default verify;