Skip to content

Commit

Permalink
Warning if not tag generated
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Mar 28, 2021
1 parent 6b5db9f commit 3acf607
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 14 deletions.
24 changes: 17 additions & 7 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 15 additions & 7 deletions src/main.ts
Expand Up @@ -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<string> = 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
Expand Down

0 comments on commit 3acf607

Please sign in to comment.