3
0
Fork 0
mirror of https://gitea.com/docker/metadata-action.git synced 2024-11-25 05:29:33 +01:00

Lowercase only on image name (#16)

This commit is contained in:
CrazyMax 2020-11-20 16:19:08 +01:00
parent 6a86fe1739
commit 2860e42b1f
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
3 changed files with 12 additions and 10 deletions

11
dist/index.js generated vendored
View file

@ -142,7 +142,7 @@ function run() {
core.info(tag); core.info(tag);
} }
core.endGroup(); core.endGroup();
core.setOutput('tags', tags.join(inputs.sepTags).toLowerCase()); core.setOutput('tags', tags.join(inputs.sepTags));
const labels = meta.labels(); const labels = meta.labels();
core.startGroup(`Docker labels`); core.startGroup(`Docker labels`);
for (let label of labels) { for (let label of labels) {
@ -250,15 +250,16 @@ class Meta {
} }
let tags = []; let tags = [];
for (const image of this.inputs.images) { 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) { for (const partial of version.partial) {
tags.push(`${image}:${partial}`); tags.push(`${imageLc}:${partial}`);
} }
if (version.latest) { if (version.latest) {
tags.push(`${image}:latest`); tags.push(`${imageLc}:latest`);
} }
if (this.context.sha && this.inputs.tagSha) { 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; return tags;

View file

@ -39,7 +39,7 @@ async function run() {
core.info(tag); core.info(tag);
} }
core.endGroup(); core.endGroup();
core.setOutput('tags', tags.join(inputs.sepTags).toLowerCase()); core.setOutput('tags', tags.join(inputs.sepTags));
const labels: Array<string> = meta.labels(); const labels: Array<string> = meta.labels();
core.startGroup(`Docker labels`); core.startGroup(`Docker labels`);

View file

@ -94,15 +94,16 @@ export class Meta {
let tags: Array<string> = []; let tags: Array<string> = [];
for (const image of this.inputs.images) { 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) { for (const partial of version.partial) {
tags.push(`${image}:${partial}`); tags.push(`${imageLc}:${partial}`);
} }
if (version.latest) { if (version.latest) {
tags.push(`${image}:latest`); tags.push(`${imageLc}:latest`);
} }
if (this.context.sha && this.inputs.tagSha) { 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; return tags;