feat: add tag-suffix and tag-prefix options

This commit is contained in:
CharlieC3
2021-03-08 16:52:14 -05:00
parent 5f29dbc7d7
commit 983af1f9f4
6 changed files with 167 additions and 8 deletions

View File

@ -134,6 +134,32 @@ describe('push', () => {
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push.env',
{
images: ['user/app'],
tagPrefix: 'prepend-',
tagSuffix: '-append'
} as Inputs,
{
main: 'dev',
partial: [],
latest: false
} as Version,
[
'user/app:prepend-dev-append'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=dev",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push_defbranch.env',
{
@ -233,6 +259,33 @@ describe('push', () => {
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tagPrefix: 'prepend-',
tagSuffix: '-append'
} as Inputs,
{
main: 'dev',
partial: [],
latest: false
} as Version,
[
'org/app:prepend-dev-append',
'ghcr.io/user/app:prepend-dev-append'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=dev",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push_defbranch.env',
{
@ -287,6 +340,36 @@ describe('push', () => {
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tagSha: true,
tagPrefix: 'prepend-',
tagSuffix: '-append'
} as Inputs,
{
main: 'dev',
partial: [],
latest: false
} as Version,
[
'org/app:prepend-dev-append',
'org/app:prepend-sha-90dd603-append',
'ghcr.io/user/app:prepend-dev-append',
'ghcr.io/user/app:prepend-sha-90dd603-append'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=dev",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push_defbranch.env',
{
@ -346,6 +429,38 @@ describe('push', () => {
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tagSha: true,
tagEdge: true,
tagEdgeBranch: 'dev',
tagPrefix: 'prepend-',
tagSuffix: '-append'
} as Inputs,
{
main: 'edge',
partial: [],
latest: false
} as Version,
[
'org/app:prepend-edge-append',
'org/app:prepend-sha-90dd603-append',
'ghcr.io/user/app:prepend-edge-append',
'ghcr.io/user/app:prepend-sha-90dd603-append'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=edge",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push_defbranch.env',
{
@ -1326,6 +1441,36 @@ describe('custom', () => {
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push.env',
{
images: ['user/app'],
tagCustom: ['my', 'custom', 'tags'],
tagPrefix: 'prepend-',
tagSuffix: '-append'
} as Inputs,
{
main: 'dev',
partial: ['my', 'custom', 'tags'],
latest: false
} as Version,
[
'user/app:prepend-dev-append',
'user/app:prepend-my-append',
'user/app:prepend-custom-append',
'user/app:prepend-tags-append'
],
[
"org.opencontainers.image.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=dev",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
[
'event_push.env',
{