From 6ca8fcc05ebedc32b51be4414616943b8d84fa57 Mon Sep 17 00:00:00 2001 From: Valentin Kiselev Date: Mon, 24 Apr 2023 11:27:48 +0300 Subject: [PATCH] fix: set NODE_COVERALLS_DEBUG before importing it --- dist/index.js | 7 ++----- src/run.ts | 8 +++----- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index c2a38d45..dc3f7d23 100644 --- a/dist/index.js +++ b/dist/index.js @@ -40761,6 +40761,7 @@ const core = __importStar(__nccwpck_require__(6024)); const fs_1 = __importDefault(__nccwpck_require__(7147)); const request_1 = __importDefault(__nccwpck_require__(2956)); const lcov_processor_1 = __nccwpck_require__(6334); +process.env.NODE_COVERALLS_DEBUG = (process.env.COVERALLS_DEBUG || core.getInput('debug')) ? '1' : ''; const coveralls = __nccwpck_require__(7532); function run() { return __awaiter(this, void 0, void 0, function* () { @@ -40774,12 +40775,8 @@ function run() { process.env.COVERALLS_GIT_COMMIT = process.env.GITHUB_SHA.toString(); process.env.COVERALLS_GIT_BRANCH = process.env.GITHUB_REF.toString(); process.env.COVERALLS_FLAG_NAME = process.env.COVERALLS_FLAG_NAME || core.getInput('flag-name'); - if (core.getInput('debug')) { - process.env.NODE_COVERALLS_DEBUG = '1'; - process.env.COVERALLS_DEBUG = '1'; - } const event = fs_1.default.readFileSync(process.env.GITHUB_EVENT_PATH, 'utf8'); - if (process.env.COVERALLS_DEBUG) { + if (process.env.NODE_COVERALLS_DEBUG) { console.log("Event Name: " + process.env.GITHUB_EVENT_NAME); console.log(event); } diff --git a/src/run.ts b/src/run.ts index 86cbbe07..f34aba94 100644 --- a/src/run.ts +++ b/src/run.ts @@ -5,6 +5,8 @@ import path from 'path'; import request, { Response } from 'request'; import { adjustLcovBasePath } from './lcov-processor'; +process.env.NODE_COVERALLS_DEBUG = (process.env.COVERALLS_DEBUG || core.getInput('debug')) ? '1' : ''; + const coveralls = require('coveralls'); interface WebhookResult { @@ -27,14 +29,10 @@ export async function run() { process.env.COVERALLS_GIT_COMMIT = process.env.GITHUB_SHA!.toString(); process.env.COVERALLS_GIT_BRANCH = process.env.GITHUB_REF!.toString(); process.env.COVERALLS_FLAG_NAME = process.env.COVERALLS_FLAG_NAME || core.getInput('flag-name'); - if (core.getInput('debug')) { - process.env.NODE_COVERALLS_DEBUG = '1' - process.env.COVERALLS_DEBUG = '1' - } const event = fs.readFileSync(process.env.GITHUB_EVENT_PATH!, 'utf8'); - if (process.env.COVERALLS_DEBUG) { + if (process.env.NODE_COVERALLS_DEBUG) { console.log("Event Name: " + process.env.GITHUB_EVENT_NAME); console.log(event); }