From 2860e42b1f503038e6fc2a32e3b8eeda2dbebf65 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Fri, 20 Nov 2020 16:19:08 +0100 Subject: [PATCH] Lowercase only on image name (#16) --- dist/index.js | 11 ++++++----- src/main.ts | 2 +- src/meta.ts | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/dist/index.js b/dist/index.js index a374c0e..1f65984 100644 --- a/dist/index.js +++ b/dist/index.js @@ -142,7 +142,7 @@ function run() { core.info(tag); } core.endGroup(); - core.setOutput('tags', tags.join(inputs.sepTags).toLowerCase()); + core.setOutput('tags', tags.join(inputs.sepTags)); const labels = meta.labels(); core.startGroup(`Docker labels`); for (let label of labels) { @@ -250,15 +250,16 @@ class Meta { } let tags = []; for (const image of this.inputs.images) { - tags.push(`${image}:${version.main}`); + const imageLc = image.toLowerCase(); + tags.push(`${imageLc}:${version.main}`); for (const partial of version.partial) { - tags.push(`${image}:${partial}`); + tags.push(`${imageLc}:${partial}`); } if (version.latest) { - tags.push(`${image}:latest`); + tags.push(`${imageLc}:latest`); } if (this.context.sha && this.inputs.tagSha) { - tags.push(`${image}:sha-${this.context.sha.substr(0, 7)}`); + tags.push(`${imageLc}:sha-${this.context.sha.substr(0, 7)}`); } } return tags; diff --git a/src/main.ts b/src/main.ts index e17efbd..d61b4fc 100644 --- a/src/main.ts +++ b/src/main.ts @@ -39,7 +39,7 @@ async function run() { core.info(tag); } core.endGroup(); - core.setOutput('tags', tags.join(inputs.sepTags).toLowerCase()); + core.setOutput('tags', tags.join(inputs.sepTags)); const labels: Array = meta.labels(); core.startGroup(`Docker labels`); diff --git a/src/meta.ts b/src/meta.ts index c0d5efa..68bee2a 100644 --- a/src/meta.ts +++ b/src/meta.ts @@ -94,15 +94,16 @@ export class Meta { let tags: Array = []; for (const image of this.inputs.images) { - tags.push(`${image}:${version.main}`); + const imageLc = image.toLowerCase(); + tags.push(`${imageLc}:${version.main}`); for (const partial of version.partial) { - tags.push(`${image}:${partial}`); + tags.push(`${imageLc}:${partial}`); } if (version.latest) { - tags.push(`${image}:latest`); + tags.push(`${imageLc}:latest`); } if (this.context.sha && this.inputs.tagSha) { - tags.push(`${image}:sha-${this.context.sha.substr(0, 7)}`); + tags.push(`${imageLc}:sha-${this.context.sha.substr(0, 7)}`); } } return tags;