mirror of
https://github.com/codecov/codecov-action.git
synced 2026-02-10 13:07:25 +00:00
Plumb failCi into verification function. (#769)
This commit is contained in:
parent
7f20bd4c41
commit
0e9e7b4e8a
2 changed files with 5 additions and 4 deletions
|
|
@ -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');
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue