mirror of
https://github.com/docker/metadata-action.git
synced 2025-06-24 03:37:59 +02:00
base_ref
global expression
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@ -340,6 +340,15 @@ export class Meta {
|
||||
sha: function () {
|
||||
return ctx.sha.substr(0, 7);
|
||||
},
|
||||
base_ref: function () {
|
||||
if (/^refs\/tags\//.test(ctx.ref)) {
|
||||
return ctx.payload?.base_ref.replace(/^refs\/heads\//g, '').replace(/\//g, '-');
|
||||
}
|
||||
if (/^refs\/pull\//.test(ctx.ref)) {
|
||||
return ctx.payload?.pull_request?.base?.ref;
|
||||
}
|
||||
return '';
|
||||
},
|
||||
date: function (format) {
|
||||
return moment(currentDate).utc().format(format);
|
||||
}
|
||||
|
Reference in New Issue
Block a user