mirror of
https://github.com/codecov/codecov-action.git
synced 2025-12-23 20:27:02 +08: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:
6
.github/workflows/main.yml
vendored
6
.github/workflows/main.yml
vendored
@@ -15,6 +15,7 @@ jobs:
|
||||
files: ./coverage/script/coverage-final.json
|
||||
flags: script,${{ matrix.os }}
|
||||
name: codecov-script
|
||||
verbose: true
|
||||
- name: Upload coverage to Codecov (demo)
|
||||
uses: ./
|
||||
with:
|
||||
@@ -22,6 +23,7 @@ jobs:
|
||||
file: ./coverage/coverage-final.json
|
||||
flags: demo,${{ matrix.os }}
|
||||
name: codecov-demo
|
||||
verbose: true
|
||||
- name: Upload coverage to Codecov (version)
|
||||
uses: ./
|
||||
with:
|
||||
@@ -30,6 +32,7 @@ jobs:
|
||||
flags: version,${{ matrix.os }}
|
||||
name: codecov-version
|
||||
version: v0.1.0_8880
|
||||
verbose: true
|
||||
run:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
@@ -50,6 +53,7 @@ jobs:
|
||||
files: ./coverage/script/coverage-final.json
|
||||
flags: script,${{ matrix.os }}
|
||||
name: codecov-script
|
||||
verbose: true
|
||||
- name: Upload coverage to Codecov (demo)
|
||||
uses: ./
|
||||
with:
|
||||
@@ -57,6 +61,7 @@ jobs:
|
||||
file: ./coverage/coverage-final.json
|
||||
flags: demo,${{ matrix.os }}
|
||||
name: codecov-demo
|
||||
verbose: true
|
||||
- name: Upload coverage to Codecov (version)
|
||||
uses: ./
|
||||
with:
|
||||
@@ -65,3 +70,4 @@ jobs:
|
||||
flags: version,${{ matrix.os }}
|
||||
name: codecov-version
|
||||
version: v0.1.0_8880
|
||||
verbose: true
|
||||
|
||||
14
dist/index.js
vendored
Normal file → Executable file
14
dist/index.js
vendored
Normal file → Executable file
@@ -19505,7 +19505,7 @@ const buildExec = () => {
|
||||
if (uploaderVersion == '') {
|
||||
uploaderVersion = 'latest';
|
||||
}
|
||||
return { execArgs, options, failCi, os, uploaderVersion };
|
||||
return { execArgs, options, failCi, os, uploaderVersion, verbose };
|
||||
};
|
||||
/* harmony default export */ const src_buildExec = (buildExec);
|
||||
|
||||
@@ -21679,7 +21679,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
|
||||
|
||||
|
||||
|
||||
const verify = (filename, platform, version) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
const verify = (filename, platform, version, verbose) => __awaiter(void 0, void 0, void 0, function* () {
|
||||
try {
|
||||
const uploaderName = getUploaderName(platform);
|
||||
// Read in public key
|
||||
@@ -21688,8 +21688,14 @@ const verify = (filename, platform, version) => __awaiter(void 0, void 0, void 0
|
||||
console.log(`${getBaseUrl(platform, version)}.SHA256SUM`);
|
||||
const shasumRes = yield fetch(`${getBaseUrl(platform, version)}.SHA256SUM`);
|
||||
const shasum = yield shasumRes.text();
|
||||
if (verbose) {
|
||||
console.log(`Received SHA256SUM ${shasum}`);
|
||||
}
|
||||
const shaSigRes = yield fetch(`${getBaseUrl(platform, version)}.SHA256SUM.sig`);
|
||||
const shaSig = yield shaSigRes.text();
|
||||
if (verbose) {
|
||||
console.log(`Received SHA256SUM signature ${shaSig}`);
|
||||
}
|
||||
// Verify shasum
|
||||
const verified = yield openpgp_min/* verify */.T({
|
||||
message: yield openpgp_min/* createMessage */.tn({ text: shasum }),
|
||||
@@ -21777,7 +21783,7 @@ var src_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
||||
|
||||
let failCi;
|
||||
try {
|
||||
const { execArgs, options, failCi, os, uploaderVersion } = src_buildExec();
|
||||
const { execArgs, options, failCi, os, uploaderVersion, verbose } = src_buildExec();
|
||||
const platform = getPlatform(os);
|
||||
const filename = external_path_.join(__dirname, getUploaderName(platform));
|
||||
external_https_.get(getBaseUrl(platform, uploaderVersion), (res) => {
|
||||
@@ -21789,7 +21795,7 @@ try {
|
||||
setFailure(`Codecov: Failed to write uploader binary: ${err.message}`, true);
|
||||
}).on('finish', () => src_awaiter(void 0, void 0, void 0, function* () {
|
||||
filePath.close();
|
||||
yield validate(filename, platform, uploaderVersion);
|
||||
yield validate(filename, platform, uploaderVersion, verbose);
|
||||
yield version(platform, uploaderVersion);
|
||||
yield external_fs_.chmodSync(filename, '777');
|
||||
const unlink = () => {
|
||||
|
||||
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
@@ -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