diff --git a/dist/index.js b/dist/index.js index 5db4164a6..02dcc1f43 100644 --- a/dist/index.js +++ b/dist/index.js @@ -259,17 +259,27 @@ function run() { core.endGroup(); const meta = new meta_1.Meta(inputs, context, repo); const version = meta.version; - core.startGroup(`Docker image version`); - core.info(version.main || ''); - core.endGroup(); + if (meta.version.main == undefined || meta.version.main.length == 0) { + core.warning(`Docker image version not found. Check tags input.`); + } + else { + core.startGroup(`Docker image version`); + core.info(version.main || ''); + core.endGroup(); + } core.setOutput('version', version.main || ''); // Docker tags const tags = meta.getTags(); - core.startGroup(`Docker tags`); - for (let tag of tags) { - core.info(tag); + if (tags.length == 0) { + core.warning('No tag has been generated. Check tags input.'); + } + else { + core.startGroup(`Docker tags`); + for (let tag of tags) { + core.info(tag); + } + core.endGroup(); } - core.endGroup(); core.setOutput('tags', tags.join(inputs.sepTags)); // Docker labels const labels = meta.getLabels(); diff --git a/src/main.ts b/src/main.ts index 27611091d..fc615d3a1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -29,18 +29,26 @@ async function run() { const meta: Meta = new Meta(inputs, context, repo); const version: Version = meta.version; - core.startGroup(`Docker image version`); - core.info(version.main || ''); - core.endGroup(); + if (meta.version.main == undefined || meta.version.main.length == 0) { + core.warning(`Docker image version not found. Check tags input.`); + } else { + core.startGroup(`Docker image version`); + core.info(version.main || ''); + core.endGroup(); + } core.setOutput('version', version.main || ''); // Docker tags const tags: Array = meta.getTags(); - core.startGroup(`Docker tags`); - for (let tag of tags) { - core.info(tag); + if (tags.length == 0) { + core.warning('No tag has been generated. Check tags input.'); + } else { + core.startGroup(`Docker tags`); + for (let tag of tags) { + core.info(tag); + } + core.endGroup(); } - core.endGroup(); core.setOutput('tags', tags.join(inputs.sepTags)); // Docker labels