mirror of
https://code.forgejo.org/docker/metadata-action.git
synced 2025-08-26 16:00:54 +00:00
base_ref
global expression
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
a287d15e54
commit
09666f941b
11 changed files with 929 additions and 10 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue