use ACTIONS_STEP_DEBUG to determine debug mode, use isTrueString lib function

This commit is contained in:
David Hiendl 2023-12-05 11:15:02 +01:00
parent adb7826676
commit cd3f3c67f2
4 changed files with 5865 additions and 2969 deletions

33
dist/index.js vendored
View File

@ -30780,7 +30780,6 @@ module.exports = parseParams
/******/ // Return the exports of the module /******/ // Return the exports of the module
/******/ return module.exports; /******/ return module.exports;
/******/ } /******/ }
/******/ /******/
/************************************************************************/ /************************************************************************/
/******/ /* webpack/runtime/make namespace object */ /******/ /* webpack/runtime/make namespace object */
@ -30830,9 +30829,19 @@ const external_process_namespaceObject = require("process");
} }
} }
function isTrueString(str) {
return str === '1'
|| str === 'true'
|| str === 'True'
|| str === 'TRUE';
}
;// CONCATENATED MODULE: ./src/collect_ci.js ;// CONCATENATED MODULE: ./src/collect_ci.js
function collect_ci(debug = false, output = false) { function collect_ci(debug = false, output = false) {
const r = { const r = {
ci_hostname: false ci_hostname: false
@ -31129,9 +31138,14 @@ const promises = {
*/ */
;// CONCATENATED MODULE: ./src/collect_git.js ;// CONCATENATED MODULE: ./src/collect_git.js
function collect_git(debug = false, output = false) { function collect_git(debug = false, output = false) {
const r = { const r = {
git_is_branch : false, git_is_branch : false,
@ -31239,21 +31253,32 @@ const promises = {
;// CONCATENATED MODULE: ./src/index.js ;// CONCATENATED MODULE: ./src/index.js
function collect_all(debug = false, output = false) { function collect_all(debug = false, output = false) {
if (debug) { if (debug) {
console.log(JSON.stringify(github.context, null, 2)); console.log(JSON.stringify(github.context, null, 2));
} }
collect_ci(debug, output); return {
collect_git(debug, output); ...collect_ci(debug, output),
...collect_git(debug, output)
};
} }
;// CONCATENATED MODULE: ./src/action.js ;// CONCATENATED MODULE: ./src/action.js
collect_all(true, true);
const debug = isTrueString(process.env['ACTIONS_STEP_DEBUG']);
collect_all(debug, true);
})(); })();

6365
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
import {collect_all} from './index'; import {collect_all} from './index';
import {isTrueString} from './lib';
const debug = process.env['ACTIONS_STEP_DEBUG'] === '1' || process.env['ACTIONS_STEP_DEBUG'] === 'true'; const debug = isTrueString(process.env['ACTIONS_STEP_DEBUG']);
collect_all(debug, true); collect_all(debug, true);

View File

@ -14,3 +14,10 @@ export function result_to_output(results) {
} }
} }
} }
export function isTrueString(str) {
return str === '1'
|| str === 'true'
|| str === 'True'
|| str === 'TRUE';
}