Added on_latest flavor to apply flavor to latest tags

This commit is contained in:
Jacob White 2021-06-16 13:15:24 -04:00
parent 94c9b333c5
commit cffbfa0b4d
No known key found for this signature in database
GPG key ID: 2E58765CE9B2BB40
5 changed files with 142 additions and 10 deletions

View file

@ -32,7 +32,8 @@ describe('transform', () => {
{
latest: "true",
prefix: "",
suffix: ""
suffix: "",
on_latest: "false"
} as Flavor,
false
],
@ -43,7 +44,8 @@ describe('transform', () => {
{
latest: "false",
prefix: "",
suffix: ""
suffix: "",
on_latest: "false"
} as Flavor,
false
],
@ -54,7 +56,8 @@ describe('transform', () => {
{
latest: "auto",
prefix: "",
suffix: ""
suffix: "",
on_latest: "false"
} as Flavor,
false
],
@ -72,7 +75,8 @@ describe('transform', () => {
{
latest: "auto",
prefix: "sha-",
suffix: ""
suffix: "",
on_latest: "false"
} as Flavor,
false
],
@ -83,7 +87,8 @@ describe('transform', () => {
{
latest: "auto",
prefix: "",
suffix: "-alpine"
suffix: "-alpine",
on_latest: "false"
} as Flavor,
false
],
@ -96,10 +101,36 @@ describe('transform', () => {
{
latest: "false",
prefix: "dev-",
suffix: "-alpine"
suffix: "-alpine",
on_latest: "false"
} as Flavor,
false
],
[
[
`latest=auto`,
`prefix=`,
`suffix=-alpine`,
`on_latest=true`
],
{
latest: "auto",
prefix: "",
suffix: "-alpine",
on_latest: "true"
} as Flavor,
false
],
[
[
`latest=true`,
`prefix=`,
`suffix=-alpine`,
`on_latest=fail`
],
{} as Flavor,
true
]
])('given %p attributes ', async (inputs: string[], expected: Flavor, invalid: boolean) => {
try {
const flavor = Transform(inputs);