mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-24 03:37:59 +02:00
Allow to disable latest tag (#23)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@ -8,7 +8,7 @@ export interface Inputs {
|
||||
tagSemver: string[];
|
||||
tagMatch: string;
|
||||
tagMatchGroup: number;
|
||||
tagMatchLatest: boolean;
|
||||
tagLatest: boolean;
|
||||
tagSchedule: string;
|
||||
sepTags: string;
|
||||
sepLabels: string;
|
||||
@ -24,7 +24,7 @@ export function getInputs(): Inputs {
|
||||
tagSemver: getInputList('tag-semver'),
|
||||
tagMatch: core.getInput('tag-match'),
|
||||
tagMatchGroup: Number(core.getInput('tag-match-group')) || 0,
|
||||
tagMatchLatest: /true/i.test(core.getInput('tag-match-latest') || 'true'),
|
||||
tagLatest: /true/i.test(core.getInput('tag-latest') || core.getInput('tag-match-latest') || 'true'),
|
||||
tagSchedule: core.getInput('tag-schedule') || 'nightly',
|
||||
sepTags: core.getInput('sep-tags') || `\n`,
|
||||
sepLabels: core.getInput('sep-labels') || `\n`,
|
||||
|
@ -57,7 +57,7 @@ export class Meta {
|
||||
if (semver.prerelease(version.main)) {
|
||||
version.main = handlebars.compile('{{version}}')(sver);
|
||||
} else {
|
||||
version.latest = true;
|
||||
version.latest = this.inputs.tagLatest;
|
||||
version.main = handlebars.compile(this.inputs.tagSemver[0])(sver);
|
||||
for (const semverTpl of this.inputs.tagSemver) {
|
||||
const partial = handlebars.compile(semverTpl)(sver);
|
||||
@ -77,10 +77,10 @@ export class Meta {
|
||||
}
|
||||
if (tagMatch) {
|
||||
version.main = tagMatch[this.inputs.tagMatchGroup];
|
||||
version.latest = this.inputs.tagMatchLatest;
|
||||
version.latest = this.inputs.tagLatest;
|
||||
}
|
||||
} else {
|
||||
version.latest = this.inputs.tagMatchLatest;
|
||||
version.latest = this.inputs.tagLatest;
|
||||
}
|
||||
} else if (/^refs\/heads\//.test(this.context.ref)) {
|
||||
version.main = this.context.ref.replace(/^refs\/heads\//g, '').replace(/\//g, '-');
|
||||
|
Reference in New Issue
Block a user