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 cd19b6d6ae
commit b819e6af29
2 changed files with 9 additions and 2 deletions

View File

@ -5,6 +5,7 @@ import {
addCiRegistryAuth, addCiRegistryAuth,
collectTags, collectTags,
executeDockerBuild, executeDockerBuild,
isTrueString,
mergeArgRegistryAuthJson, mergeArgRegistryAuthJson,
prepareDestinations, prepareDestinations,
prepareDockerArgs, prepareDockerArgs,
@ -16,8 +17,7 @@ import {
try { try {
const information = action_information.collect_all(true, false); const information = action_information.collect_all(true, false);
const debug = process.env['ACTIONS_STEP_DEBUG'] === '1' || process.env['ACTIONS_STEP_DEBUG'] === 'true'; const debug = isTrueString(process.env['ACTIONS_STEP_DEBUG']);
console.log('debug=', debug);
let targetRegistries = []; let targetRegistries = [];
const repoStr = github.context.repo.owner + '/' + github.context.repo.repo; const repoStr = github.context.repo.owner + '/' + github.context.repo.repo;

View File

@ -230,3 +230,10 @@ export function executeDockerBuild(dockerArgs, destinations) {
throw proc.error; throw proc.error;
} }
} }
export function isTrueString(str) {
return str === '1'
|| str === 'true'
|| str === 'True'
|| str === 'TRUE';
}