mirror of
https://github.com/docker/metadata-action.git
synced 2025-08-16 02:39:52 +08:00
allow to match part of the git tag or value for semver type
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -1971,6 +1971,69 @@ describe('tag', () => {
|
||||
"org.opencontainers.image.version=1.1.1"
|
||||
],
|
||||
undefined
|
||||
],
|
||||
[
|
||||
'tag34',
|
||||
'event_tag_p1-v1.0.0.env',
|
||||
{
|
||||
images: ['org/app'],
|
||||
tags: [
|
||||
`type=semver,pattern={{version}},"match=v(\\d.\\d.\\d)$"`,
|
||||
]
|
||||
} as Inputs,
|
||||
{
|
||||
main: '1.0.0',
|
||||
partial: [],
|
||||
latest: true
|
||||
} as Version,
|
||||
[
|
||||
'org/app:1.0.0',
|
||||
'org/app:latest'
|
||||
],
|
||||
[
|
||||
"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=1.0.0"
|
||||
],
|
||||
undefined
|
||||
],
|
||||
[
|
||||
'push35',
|
||||
'event_push_master.env',
|
||||
{
|
||||
images: ['user/app'],
|
||||
tags: [
|
||||
`type=semver,pattern={{version}},value=p1/v1.2.3,"match=v(\\d.\\d.\\d)$"`,
|
||||
`type=pep440,pattern={{version}},value=p1/v1.2.3,"match=v(\\d.\\d.\\d)$"`,
|
||||
`type=edge`
|
||||
],
|
||||
} as Inputs,
|
||||
{
|
||||
main: '1.2.3',
|
||||
partial: ['edge'],
|
||||
latest: true
|
||||
} as Version,
|
||||
[
|
||||
'user/app:1.2.3',
|
||||
'user/app:edge',
|
||||
'user/app:latest'
|
||||
],
|
||||
[
|
||||
"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=266574110acf203503badf966df2ea24b5d732d7",
|
||||
"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=1.2.3"
|
||||
],
|
||||
undefined
|
||||
]
|
||||
])('given %p with %p event', tagsLabelsTest);
|
||||
});
|
||||
|
@@ -32,7 +32,8 @@ describe('transform', () => {
|
||||
"priority": DefaultPriorities[Type.Semver],
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
"value": "",
|
||||
"match": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -147,7 +148,8 @@ describe('parse', () => {
|
||||
"priority": DefaultPriorities[Type.Semver],
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
"value": "",
|
||||
"match": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@@ -160,7 +162,8 @@ describe('parse', () => {
|
||||
"priority": "1",
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": ""
|
||||
"value": "",
|
||||
"match": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
@@ -173,7 +176,22 @@ describe('parse', () => {
|
||||
"priority": "1",
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": "v1.0.0"
|
||||
"value": "v1.0.0",
|
||||
"match": ""
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
],
|
||||
[
|
||||
`type=semver,priority=1,enable=true,pattern={{version}},value=p1/v1.0.0,"match=v(\\d.\\d.\\d)$"`,
|
||||
{
|
||||
type: Type.Semver,
|
||||
attrs: {
|
||||
"priority": "1",
|
||||
"enable": "true",
|
||||
"pattern": "{{version}}",
|
||||
"value": "p1/v1.0.0",
|
||||
"match": "v(\\d.\\d.\\d)$"
|
||||
}
|
||||
} as Tag,
|
||||
false
|
||||
|
Reference in New Issue
Block a user