Signed-off-by: zry98 <dev@zry.io>
This commit is contained in:
zry98 2026-05-22 19:29:20 +02:00
parent 10895fcef4
commit c4641c96cc
No known key found for this signature in database
GPG key ID: D239A8A2222B2691
4 changed files with 254 additions and 2 deletions

View file

@ -3929,7 +3929,7 @@ describe('raw', () => {
{ {
images: ['user/app'], images: ['user/app'],
tags: [ tags: [
`type=raw,value=.t/'\[e]-=` `type=raw,value=.t/'[e]-=`
], ],
flavor: [ flavor: [
`latest=false` `latest=false`
@ -4019,6 +4019,131 @@ describe('raw', () => {
], ],
undefined undefined
], ],
[
'raw14',
'event_push_dev.env',
{
images: ['user/app'],
tags: [
`type=raw,value= `
],
flavor: [
`latest=false`
]
} as Inputs,
{
main: undefined,
partial: [],
latest: false
} as Version,
[],
[
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.licenses=MIT",
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version="
],
undefined
],
[
'raw15',
'event_push_dev.env',
{
images: ['user/app'],
tags: [
`type=raw,value=.-`
],
flavor: [
`latest=false`
]
} as Inputs,
{
main: undefined,
partial: [],
latest: false
} as Version,
[],
[
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.licenses=MIT",
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version="
],
undefined
],
[
'raw16',
'event_push_dev.env',
{
images: ['user/app'],
tags: [
`type=raw,value=_leading_underscore`
],
flavor: [
`latest=false`
]
} as Inputs,
{
main: '_leading_underscore',
partial: [],
latest: false
} as Version,
[
'user/app:_leading_underscore'
],
[
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.licenses=MIT",
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=_leading_underscore"
],
undefined
],
[
'raw17',
'event_push_dev.env',
{
images: ['user/app'],
tags: [
`type=raw,value=.-,priority=300`,
`type=raw,value=foobar,priority=200`
],
flavor: [
`latest=false`
]
} as Inputs,
{
main: 'foobar',
partial: [],
latest: false
} as Version,
[
'user/app:foobar'
],
[
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.licenses=MIT",
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=foobar"
],
undefined
],
])('given %o with %o event', tagsLabelsTest); ])('given %o with %o event', tagsLabelsTest);
}); });

115
dist/index.cjs generated vendored

File diff suppressed because one or more lines are too long

7
dist/index.cjs.map generated vendored

File diff suppressed because one or more lines are too long

View file

@ -358,7 +358,12 @@ export class Meta {
if (val.length == 0) { if (val.length == 0) {
return version; return version;
} }
val = Meta.sanitizeTag(val); const sanitized = Meta.sanitizeTag(val);
if (sanitized.length == 0) {
core.warning(`Skipping tag "${val}": sanitization resulted in an empty string.`);
return version;
}
val = sanitized;
if (version.main == undefined) { if (version.main == undefined) {
version.main = val; version.main = val;
} else if (val !== version.main) { } else if (val !== version.main) {