mirror of
https://github.com/codecov/codecov-action.git
synced 2026-03-29 17:35:06 +00:00
fix: add more verbosity to validation (#747)
* fix: add more verbosity to validation * fix: more verbosity on tests * fix: use proper variable for sig
This commit is contained in:
@@ -176,7 +176,7 @@ const buildExec = () => {
|
||||
uploaderVersion = 'latest';
|
||||
}
|
||||
|
||||
return {execArgs, options, failCi, os, uploaderVersion};
|
||||
return {execArgs, options, failCi, os, uploaderVersion, verbose};
|
||||
};
|
||||
|
||||
export default buildExec;
|
||||
|
||||
@@ -18,7 +18,7 @@ import versionInfo from './version';
|
||||
let failCi;
|
||||
|
||||
try {
|
||||
const {execArgs, options, failCi, os, uploaderVersion} = buildExec();
|
||||
const {execArgs, options, failCi, os, uploaderVersion, verbose} = buildExec();
|
||||
const platform = getPlatform(os);
|
||||
|
||||
const filename = path.join( __dirname, getUploaderName(platform));
|
||||
@@ -35,7 +35,7 @@ try {
|
||||
}).on('finish', async () => {
|
||||
filePath.close();
|
||||
|
||||
await verify(filename, platform, uploaderVersion);
|
||||
await verify(filename, platform, uploaderVersion, verbose);
|
||||
await versionInfo(platform, uploaderVersion);
|
||||
await fs.chmodSync(filename, '777');
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ const verify = async (
|
||||
filename: string,
|
||||
platform: string,
|
||||
version: string,
|
||||
verbose: boolean,
|
||||
): Promise<void> => {
|
||||
try {
|
||||
const uploaderName = getUploaderName(platform);
|
||||
@@ -32,11 +33,17 @@ const verify = async (
|
||||
`${getBaseUrl(platform, version)}.SHA256SUM`,
|
||||
);
|
||||
const shasum = await shasumRes.text();
|
||||
if (verbose) {
|
||||
console.log(`Received SHA256SUM ${shasum}`);
|
||||
}
|
||||
|
||||
const shaSigRes = await fetch.default(
|
||||
`${getBaseUrl(platform, version)}.SHA256SUM.sig`,
|
||||
);
|
||||
const shaSig = await shaSigRes.text();
|
||||
if (verbose) {
|
||||
console.log(`Received SHA256SUM signature ${shaSig}`);
|
||||
}
|
||||
|
||||
// Verify shasum
|
||||
const verified = await openpgp.verify({
|
||||
|
||||
Reference in New Issue
Block a user