mirror of
https://github.com/docker/metadata-action.git
synced 2026-05-14 05:20:31 +00:00
Merge bd9134e031 into aa5e42bc43
This commit is contained in:
commit
b36d9ccefd
2 changed files with 97 additions and 1 deletions
|
|
@ -3923,6 +3923,102 @@ describe('raw', () => {
|
|||
],
|
||||
undefined
|
||||
],
|
||||
[
|
||||
'raw11',
|
||||
'event_push_dev.env',
|
||||
{
|
||||
images: ['user/app'],
|
||||
tags: [
|
||||
`type=raw,value=.t/'\[e]-=`
|
||||
],
|
||||
flavor: [
|
||||
`latest=false`
|
||||
]
|
||||
} as Inputs,
|
||||
{
|
||||
main: 't-e---',
|
||||
partial: [],
|
||||
latest: false
|
||||
} as Version,
|
||||
[
|
||||
'user/app:t-e---'
|
||||
],
|
||||
[
|
||||
"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=t-e---"
|
||||
],
|
||||
undefined
|
||||
],
|
||||
[
|
||||
'raw12',
|
||||
'event_push_dev.env',
|
||||
{
|
||||
images: ['user/app'],
|
||||
tags: [
|
||||
`type=raw,value=-foobar`
|
||||
],
|
||||
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
|
||||
],
|
||||
[
|
||||
'raw13',
|
||||
'event_push_dev.env',
|
||||
{
|
||||
images: ['user/app'],
|
||||
tags: [
|
||||
`type=raw,value=...---foo.bar`
|
||||
],
|
||||
flavor: [
|
||||
`latest=false`
|
||||
]
|
||||
} as Inputs,
|
||||
{
|
||||
main: 'foo.bar',
|
||||
partial: [],
|
||||
latest: false
|
||||
} as Version,
|
||||
[
|
||||
'user/app:foo.bar'
|
||||
],
|
||||
[
|
||||
"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=foo.bar"
|
||||
],
|
||||
undefined
|
||||
],
|
||||
])('given %o with %o event', tagsLabelsTest);
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -656,7 +656,7 @@ export class Meta {
|
|||
}
|
||||
|
||||
private static sanitizeTag(tag: string): string {
|
||||
return tag.replace(/[^a-zA-Z0-9._-]+/g, '-');
|
||||
return tag.replace(/[^a-zA-Z0-9._-]+/g, '-').replace(/^[^a-zA-Z0-9_]+/, '');
|
||||
}
|
||||
|
||||
private static shortSha(sha: string): string {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue