mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-23 19:27:58 +02:00
Allow to override flavor (#63)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
10
dist/index.js
generated
vendored
10
dist/index.js
generated
vendored
@ -634,13 +634,13 @@ class Meta {
|
||||
return version;
|
||||
}
|
||||
setFlavor(val, tag) {
|
||||
if (tag.attrs['prefix'].length > 0) {
|
||||
if (tag.attrs.hasOwnProperty('prefix')) {
|
||||
val = `${tag.attrs['prefix']}${val}`;
|
||||
}
|
||||
else if (this.flavor.prefix.length > 0) {
|
||||
val = `${this.flavor.prefix}${val}`;
|
||||
}
|
||||
if (tag.attrs['suffix'].length > 0) {
|
||||
if (tag.attrs.hasOwnProperty('suffix')) {
|
||||
val = `${val}${tag.attrs['suffix']}`;
|
||||
}
|
||||
else if (this.flavor.suffix.length > 0) {
|
||||
@ -912,12 +912,6 @@ function Parse(s) {
|
||||
if (!tag.attrs.hasOwnProperty('priority')) {
|
||||
tag.attrs['priority'] = exports.DefaultPriorities[tag.type];
|
||||
}
|
||||
if (!tag.attrs.hasOwnProperty('prefix')) {
|
||||
tag.attrs['prefix'] = '';
|
||||
}
|
||||
if (!tag.attrs.hasOwnProperty('suffix')) {
|
||||
tag.attrs['suffix'] = '';
|
||||
}
|
||||
if (!['true', 'false'].includes(tag.attrs['enable'])) {
|
||||
throw new Error(`Invalid value for enable attribute: ${tag.attrs['enable']}`);
|
||||
}
|
||||
|
Reference in New Issue
Block a user