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.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;

View File

@ -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<string> = meta.labels();
core.startGroup(`Docker labels`);

View File

@ -94,15 +94,16 @@ export class Meta {
let tags: Array<string> = [];
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;