mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-24 03:37:59 +02:00
Set latest tag only if matches with a pattern
This commit is contained in:
@ -6,6 +6,7 @@ export interface Inputs {
|
||||
tagEdge: boolean;
|
||||
tagEdgeBranch: string;
|
||||
tagCoerceTag: string;
|
||||
tagLatestMatch: string;
|
||||
tagSchedule: string;
|
||||
sepTags: string;
|
||||
sepLabels: string;
|
||||
@ -19,6 +20,7 @@ export function getInputs(): Inputs {
|
||||
tagEdge: /true/i.test(core.getInput('tag-edge') || 'false'),
|
||||
tagEdgeBranch: core.getInput('tag-edge-branch'),
|
||||
tagCoerceTag: core.getInput('tag-coerce-tag'),
|
||||
tagLatestMatch: core.getInput('tag-latest-match'),
|
||||
tagSchedule: core.getInput('tag-schedule') || 'nightly',
|
||||
sepTags: core.getInput('sep-tags') || `\n`,
|
||||
sepLabels: core.getInput('sep-labels') || `\n`,
|
||||
|
@ -68,6 +68,11 @@ export class Meta {
|
||||
version.version = `pr-${this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, '')}`;
|
||||
}
|
||||
|
||||
if (this.inputs.tagLatestMatch) {
|
||||
const match = version.version?.match(new RegExp(this.inputs.tagLatestMatch));
|
||||
version.latest = match !== null;
|
||||
}
|
||||
|
||||
return version;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user