Allow to add custom tags (#24)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
14
src/meta.ts
14
src/meta.ts
@@ -33,7 +33,7 @@ export class Meta {
|
||||
|
||||
private getVersion(): Version {
|
||||
const currentDate = this.date;
|
||||
const version: Version = {
|
||||
let version: Version = {
|
||||
main: undefined,
|
||||
partial: [],
|
||||
latest: false
|
||||
@@ -91,6 +91,18 @@ export class Meta {
|
||||
version.main = `pr-${this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, '')}`;
|
||||
}
|
||||
|
||||
if (this.inputs.tagCustom.length > 0) {
|
||||
if (this.inputs.tagCustomOnly) {
|
||||
version = {
|
||||
main: this.inputs.tagCustom.shift(),
|
||||
partial: this.inputs.tagCustom,
|
||||
latest: false
|
||||
};
|
||||
} else {
|
||||
version.partial.push(...this.inputs.tagCustom);
|
||||
}
|
||||
}
|
||||
|
||||
version.partial = version.partial.filter((item, index) => version.partial.indexOf(item) === index);
|
||||
return version;
|
||||
}
|
||||
|
Reference in New Issue
Block a user