From 3d71b87cec08a565ce5e73e26dd18f53b9e1fdea Mon Sep 17 00:00:00 2001 From: Tomas Cerny Date: Tue, 31 Oct 2023 11:24:45 +0100 Subject: [PATCH] use DEBUG env var instead of CI --- .github/workflows/tests.yml | 1 + .github/workflows/tests_output.yml | 1 + lib/debug.js | 2 +- lib/openssl.js | 2 +- test/pem.helper.js | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 1b7163d9..661eaa2e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,6 +11,7 @@ concurrency: cancel-in-progress: true env: TARGET: x86_64-unknown-linux-gnu + DEBUG: true jobs: build: name: Build and Test PEM diff --git a/.github/workflows/tests_output.yml b/.github/workflows/tests_output.yml index 3307e288..b4f43400 100644 --- a/.github/workflows/tests_output.yml +++ b/.github/workflows/tests_output.yml @@ -3,6 +3,7 @@ on: workflow_dispatch: env: TARGET: x86_64-unknown-linux-gnu + DEBUG: true jobs: build: name: RuN!!!! diff --git a/lib/debug.js b/lib/debug.js index 21edf1ca..8e2b6909 100644 --- a/lib/debug.js +++ b/lib/debug.js @@ -1,5 +1,5 @@ function debug (title, content) { - if (process.env.CI === 'true') { + if (process.env.DEBUG === 'true') { console.log(`::group::${title}`) console.log(JSON.stringify(content, null, 3)) console.log('::endgroup::') diff --git a/lib/openssl.js b/lib/openssl.js index ac8e0149..ed338168 100644 --- a/lib/openssl.js +++ b/lib/openssl.js @@ -12,7 +12,7 @@ var tempDir = process.env.PEMJS_TMPDIR || osTmpdir() const versionRegEx = new RegExp('^(OpenSSL|LibreSSL) (((\\d+).(\\d+)).(\\d+))([a-z]+)?') -if ("CI" in process.env && process.env.CI === 'true') { +if ("DEBUG" in process.env && process.env.DEBUG === 'true') { if ("LIBRARY" in process.env && "VERSION" in process.env && process.env.LIBRARY != "" && process.env.VERSION != "") { const filePathOpenSSL=`./openssl/${process.env.LIBRARY}_v${process.env.VERSION}/bin/openssl` if (fs.existsSync(filePathOpenSSL)) { diff --git a/test/pem.helper.js b/test/pem.helper.js index 243c5193..ab6f8f15 100644 --- a/test/pem.helper.js +++ b/test/pem.helper.js @@ -10,7 +10,7 @@ chai.use(dirtyChai) process.env.PEMJS_TMPDIR = './tmp' debug("ENVs:", process.env) -if ((process.env.TRAVIS === 'true' || process.env.CI === 'true') && "OPENSSL_DIR" in process.env && !("OPENSSL_BIN" in process.env)) { +if ((process.env.TRAVIS === 'true' || process.env.DEBUG === 'true') && "OPENSSL_DIR" in process.env && !("OPENSSL_BIN" in process.env)) { process.env.OPENSSL_BIN = process.env.GITHUB_WORKSPACE+'/openssl/bin/openssl' }