2022-03-22 21:09:00 +01:00
|
|
|
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
|
2020-10-25 02:25:23 +01:00
|
|
|
import * as fs from 'fs';
|
|
|
|
import * as path from 'path';
|
|
|
|
import * as dotenv from 'dotenv';
|
2023-02-20 22:32:55 +01:00
|
|
|
import {GitHub} from '@docker/actions-toolkit/lib/github';
|
|
|
|
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
|
|
|
|
import {GitHubRepo} from '@docker/actions-toolkit/lib/types/github';
|
2023-04-17 04:42:21 +02:00
|
|
|
import {Context} from '@actions/github/lib/context';
|
|
|
|
|
|
|
|
import {ContextSource, getContext, getInputs, Inputs} from '../src/context';
|
2023-02-20 22:32:55 +01:00
|
|
|
import {Meta, Version} from '../src/meta';
|
2020-10-25 02:25:23 +01:00
|
|
|
|
2023-02-20 22:32:55 +01:00
|
|
|
import repoFixture from './fixtures/repo.json';
|
2023-04-17 04:42:21 +02:00
|
|
|
|
2023-02-20 22:32:55 +01:00
|
|
|
jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise<GitHubRepo> => {
|
|
|
|
return <Promise<GitHubRepo>>(repoFixture as unknown);
|
2021-07-06 20:01:00 +02:00
|
|
|
});
|
2020-10-25 02:25:23 +01:00
|
|
|
|
|
|
|
jest.spyOn(global.Date.prototype, 'toISOString').mockImplementation(() => {
|
|
|
|
return '2020-01-10T00:30:00.000Z';
|
|
|
|
});
|
|
|
|
|
2022-12-29 01:01:17 +01:00
|
|
|
jest.mock('moment-timezone', () => {
|
|
|
|
return () => (jest.requireActual('moment-timezone') as typeof import('moment-timezone'))('2020-01-10T00:30:00.000Z');
|
2020-10-25 15:13:43 +01:00
|
|
|
});
|
|
|
|
|
2020-10-26 01:39:21 +01:00
|
|
|
beforeEach(() => {
|
2023-02-20 22:32:55 +01:00
|
|
|
jest.clearAllMocks();
|
2020-10-26 01:39:21 +01:00
|
|
|
Object.keys(process.env).forEach(function (key) {
|
|
|
|
if (key !== 'GITHUB_TOKEN' && key.startsWith('GITHUB_')) {
|
|
|
|
delete process.env[key];
|
|
|
|
}
|
2020-10-25 02:25:23 +01:00
|
|
|
});
|
2023-04-17 04:42:21 +02:00
|
|
|
jest.spyOn(GitHub, 'context', 'get').mockImplementation((): Context => {
|
|
|
|
return new Context();
|
|
|
|
});
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
2021-12-06 15:40:44 +01:00
|
|
|
describe('isRawStatement', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
test.each([
|
|
|
|
['{{ raw }}.{{ version }}', false],
|
|
|
|
['{{ version }},{{raw }.', false],
|
|
|
|
['{{ raw }}', true],
|
|
|
|
['{{ raw}}', true],
|
|
|
|
['{{raw}}', true],
|
2022-03-22 21:09:00 +01:00
|
|
|
])('given %p pattern', async (pattern: string, expected: boolean) => {
|
2021-12-06 15:40:44 +01:00
|
|
|
expect(Meta.isRawStatement(pattern)).toEqual(expected);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
const tagsLabelsTest = async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
|
2020-10-26 01:39:21 +01:00
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
2023-02-20 22:32:55 +01:00
|
|
|
const toolkit = new Toolkit();
|
|
|
|
const repo = await toolkit.github.repoData();
|
2023-04-17 04:42:21 +02:00
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
|
2020-10-26 01:39:21 +01:00
|
|
|
|
2020-12-01 05:38:08 +01:00
|
|
|
const version = meta.version;
|
2020-10-26 01:39:21 +01:00
|
|
|
expect(version).toEqual(exVersion);
|
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
const tags = meta.getTags();
|
2020-10-26 01:39:21 +01:00
|
|
|
expect(tags).toEqual(exTags);
|
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
const labels = meta.getLabels();
|
2020-10-26 01:39:21 +01:00
|
|
|
expect(labels).toEqual(exLabels);
|
|
|
|
};
|
2020-10-25 02:25:23 +01:00
|
|
|
|
2020-10-26 01:39:21 +01:00
|
|
|
describe('null', () => {
|
2020-10-25 02:25:23 +01:00
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-25 02:25:23 +01:00
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'null01',
|
2020-10-25 02:25:23 +01:00
|
|
|
'event_null.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: undefined,
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.revision=",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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="
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'null02',
|
2020-10-25 02:25:23 +01:00
|
|
|
'event_empty.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-05-07 21:53:30 +02:00
|
|
|
`type=sha`,
|
|
|
|
`type=raw,{{branch}}`,
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: undefined,
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.revision=",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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="
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('push', () => {
|
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-26 01:39:21 +01:00
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push01',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:dev'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=dev"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push02',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge`
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:edge'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=edge"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push03',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'master',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:master'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=master"
|
2020-10-26 01:39:21 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push04',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_workflow_dispatch.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge`
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
|
|
|
'user/app:edge'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=edge"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push05',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'dev',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:dev',
|
|
|
|
'ghcr.io/user/app:dev'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=dev"
|
2020-10-26 01:39:21 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-25 15:32:14 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push06',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2020-10-25 15:32:14 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge`
|
|
|
|
],
|
2020-10-25 15:32:14 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 15:32:14 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:edge',
|
|
|
|
'ghcr.io/user/app:edge'
|
2020-10-25 15:32:14 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=edge"
|
2020-10-25 15:32:14 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push07',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['sha-860c190'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=dev"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push08',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['sha-2665741'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:edge',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-2665741',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:edge',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-2665741'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=edge"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push09',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-10-25 15:13:43 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge,branch=dev`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'edge',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['sha-860c190'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 15:13:43 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:edge',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:edge',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190'
|
2020-10-25 15:13:43 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=edge"
|
2020-10-25 15:13:43 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push10',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2020-10-25 15:13:43 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge,branch=dev`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'sha-2665741',
|
2021-07-12 17:08:07 +02:00
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 15:13:43 +01:00
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-2665741',
|
|
|
|
'ghcr.io/user/app:sha-2665741'
|
2020-10-25 15:13:43 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-2665741"
|
2020-12-08 00:01:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'push11',
|
2020-12-08 00:01:39 +01:00
|
|
|
'event_push_invalidchars.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=edge`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
2020-12-08 00:01:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'sha-983315b',
|
2021-07-12 17:08:07 +02:00
|
|
|
partial: [],
|
2020-12-08 00:01:39 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-983315b',
|
|
|
|
'ghcr.io/user/app:sha-983315b'
|
2020-12-08 00:01:39 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=983315b5e8d46e46fc4c49869e85e7ee5fb289ba",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-983315b"
|
2020-10-25 15:13:43 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
[
|
|
|
|
'push12',
|
|
|
|
'event_push_invalidchars.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
2021-07-06 13:56:48 +02:00
|
|
|
`type=pep440,pattern={{version}}`,
|
2021-03-29 13:04:53 +02:00
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-07-12 17:08:07 +02:00
|
|
|
main: undefined,
|
2021-03-29 13:04:53 +02:00
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
2021-07-12 17:08:07 +02:00
|
|
|
[],
|
2021-03-29 13:04:53 +02:00
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=983315b5e8d46e46fc4c49869e85e7ee5fb289ba",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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="
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push13',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2021-03-29 13:04:53 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,priority=2000,event=branch`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'master',
|
|
|
|
partial: ['edge'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:master',
|
|
|
|
'user/app:edge'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=master"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push14',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2021-03-29 13:04:53 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}},value=v1.2.3`,
|
2021-07-06 13:56:48 +02:00
|
|
|
`type=pep440,pattern={{version}},value=v1.2.3`,
|
2021-03-29 13:04:53 +02:00
|
|
|
`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",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push15',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2021-03-29 13:04:53 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=v(.*),group=1,value=v1.2.3`,
|
|
|
|
`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",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2021-03-30 13:57:28 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'push16',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2021-03-30 13:57:28 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,enable=false,pattern=v(.*),group=1,value=v1.2.3`,
|
|
|
|
`type=edge`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'edge',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:edge'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=edge"
|
2021-03-30 13:57:28 +02:00
|
|
|
]
|
2021-05-07 21:53:30 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'push17',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_master.env',
|
2021-05-07 21:53:30 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,value=mytag-{{branch}}`,
|
2021-08-19 19:58:11 +02:00
|
|
|
`type=raw,value=mytag-{{date 'YYYYMMDD'}}`,
|
2022-12-29 01:01:17 +01:00
|
|
|
`type=raw,value=mytag-{{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}`,
|
2021-10-22 13:14:38 +02:00
|
|
|
`type=raw,value=mytag-tag-{{tag}}`,
|
2022-04-25 13:41:39 +02:00
|
|
|
`type=raw,value=mytag-baseref-{{base_ref}}`,
|
|
|
|
`type=raw,value=mytag-defbranch,enable={{is_default_branch}}`
|
2021-05-07 21:53:30 +02:00
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'mytag-master',
|
2021-10-22 13:14:38 +02:00
|
|
|
partial: [
|
|
|
|
'mytag-20200110',
|
2022-12-29 01:01:17 +01:00
|
|
|
'mytag-20200110-093000',
|
2021-10-22 13:14:38 +02:00
|
|
|
'mytag-tag-',
|
2022-04-25 13:41:39 +02:00
|
|
|
'mytag-baseref-',
|
|
|
|
'mytag-defbranch'
|
2021-10-22 13:14:38 +02:00
|
|
|
],
|
2021-05-07 21:53:30 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:mytag-master',
|
2021-08-19 19:58:11 +02:00
|
|
|
'user/app:mytag-20200110',
|
2022-12-29 01:01:17 +01:00
|
|
|
'user/app:mytag-20200110-093000',
|
2021-10-22 13:14:38 +02:00
|
|
|
'user/app:mytag-tag-',
|
2022-04-25 13:41:39 +02:00
|
|
|
'user/app:mytag-baseref-',
|
|
|
|
'user/app:mytag-defbranch'
|
2021-05-07 21:53:30 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=mytag-master"
|
2021-05-07 21:53:30 +02:00
|
|
|
]
|
2021-05-11 20:14:23 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'push18',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-05-25 18:45:23 +02:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=sha,format=long`
|
2021-05-11 20:14:23 +02:00
|
|
|
],
|
2021-05-25 18:45:23 +02:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['sha-860c1904a1ce19322e91ac35af1ab07466440c37'],
|
2021-05-25 18:45:23 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c1904a1ce19322e91ac35af1ab07466440c37',
|
2021-05-25 18:45:23 +02:00
|
|
|
'ghcr.io/user/app:dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c1904a1ce19322e91ac35af1ab07466440c37'
|
2021-05-11 20:14:23 +02:00
|
|
|
],
|
2021-05-25 18:45:23 +02:00
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=dev"
|
2021-05-25 18:45:23 +02:00
|
|
|
]
|
2021-07-12 17:08:07 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'push19',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-07-12 17:08:07 +02:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=edge,branch=master`,
|
|
|
|
`type=ref,event=branch,enable=false`,
|
2022-04-25 13:41:39 +02:00
|
|
|
`type=sha,format=long`,
|
|
|
|
`type=raw,value=defbranch,enable={{is_default_branch}}`
|
2021-07-12 17:08:07 +02:00
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'sha-860c1904a1ce19322e91ac35af1ab07466440c37',
|
2021-07-12 17:08:07 +02:00
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c1904a1ce19322e91ac35af1ab07466440c37',
|
|
|
|
'ghcr.io/user/app:sha-860c1904a1ce19322e91ac35af1ab07466440c37'
|
2021-07-12 17:08:07 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
2022-04-27 16:58:50 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'push20',
|
|
|
|
'event_push_dev.env',
|
|
|
|
{
|
|
|
|
images: [
|
|
|
|
'org/app',
|
|
|
|
'ghcr.io/user/app,enable=false'
|
|
|
|
],
|
|
|
|
tags: [
|
|
|
|
`type=edge,branch=master`,
|
|
|
|
`type=ref,event=branch,enable=false`,
|
|
|
|
`type=sha,format=long`
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sha-860c1904a1ce19322e91ac35af1ab07466440c37',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:sha-860c1904a1ce19322e91ac35af1ab07466440c37'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-27 16:58:50 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-860c1904a1ce19322e91ac35af1ab07466440c37"
|
2021-07-12 17:08:07 +02:00
|
|
|
]
|
2021-05-25 18:45:23 +02:00
|
|
|
]
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
describe('tag', () => {
|
2020-10-26 01:39:21 +01:00
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-26 01:39:21 +01:00
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag01',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_release1.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'release1',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-28 18:25:31 +01:00
|
|
|
'user/app:release1',
|
|
|
|
'user/app:latest'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=release1"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag02',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110-RC2',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-28 18:25:31 +01:00
|
|
|
'user/app:20200110-RC2',
|
|
|
|
'user/app:latest'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110-RC2"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag03',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 00:57:32 +01:00
|
|
|
latest: false
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'user/app:20200110'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
2020-10-27 02:32:26 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110"
|
2020-10-27 02:32:26 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag04',
|
2020-10-27 02:32:26 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=(.*)-RC,group=1`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-10-27 02:32:26 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-27 02:32:26 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110'
|
|
|
|
],
|
|
|
|
[
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag05',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-11-17 23:31:03 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag06',
|
2020-11-17 23:31:03 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=^v(\\d.\\d.\\d)$",group=1`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-11-17 23:31:03 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag07',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d-(alpha|beta).\\d+"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '2.0.8-beta.67',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:2.0.8-beta.67',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=2.0.8-beta.67"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag08',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '2.0',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:2.0',
|
2020-10-25 02:25:23 +01:00
|
|
|
'org/app:latest',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:2.0',
|
2020-10-25 02:25:23 +01:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=2.0"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2020-11-17 23:31:03 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag09',
|
2020-11-17 23:31:03 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-05 21:19:05 +02:00
|
|
|
`type=match,"pattern=v(.*)-beta.(.*)",group=1`,
|
|
|
|
`type=match,"pattern=v(.*)-beta.(.*)",group=2`,
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-11-17 23:31:03 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-04-05 21:19:05 +02:00
|
|
|
main: '2.0.8',
|
|
|
|
partial: ['67'],
|
|
|
|
latest: true
|
2020-11-17 23:31:03 +01:00
|
|
|
} as Version,
|
|
|
|
[
|
2021-04-05 21:19:05 +02:00
|
|
|
'org/app:2.0.8',
|
|
|
|
'org/app:67',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:2.0.8',
|
|
|
|
'ghcr.io/user/app:67',
|
|
|
|
'ghcr.io/user/app:latest'
|
2020-11-17 23:31:03 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=2.0.8"
|
2020-11-17 23:31:03 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-26 01:39:21 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag10',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-04-05 21:19:05 +02:00
|
|
|
main: undefined,
|
2020-11-17 23:31:03 +01:00
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2021-04-05 21:19:05 +02:00
|
|
|
[],
|
2020-10-26 01:39:21 +01:00
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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="
|
2020-10-26 01:39:21 +01:00
|
|
|
]
|
|
|
|
],
|
2020-11-17 23:31:03 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag11',
|
2020-11-17 23:31:03 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`
|
|
|
|
]
|
2020-11-17 23:31:03 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: ['1.1', '1'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:1.1',
|
|
|
|
'org/app:1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:1.1',
|
|
|
|
'ghcr.io/user/app:1',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-11-18 01:10:05 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag12',
|
2020-11-18 01:10:05 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}.{{patch}}`
|
|
|
|
]
|
2020-11-18 01:10:05 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-11-17 23:31:03 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag13',
|
2020-11-17 23:31:03 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`
|
|
|
|
]
|
2020-11-17 23:31:03 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '2.0.8-beta.67',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:2.0.8-beta.67'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=2.0.8-beta.67"
|
2020-12-01 05:50:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'tag14',
|
2020-12-01 05:50:39 +01:00
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-12-01 05:50:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sometag',
|
|
|
|
partial: [],
|
2020-12-01 06:29:34 +01:00
|
|
|
latest: false
|
2020-12-01 05:50:39 +01:00
|
|
|
} as Version,
|
|
|
|
[
|
2020-12-01 06:29:34 +01:00
|
|
|
'ghcr.io/user/app:sometag'
|
2020-12-01 05:50:39 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sometag"
|
2020-11-17 23:31:03 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
[
|
|
|
|
'tag15',
|
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,priority=2000,foo`,
|
|
|
|
`type=semver,pattern={{version}}`,
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo',
|
|
|
|
partial: ['2.0.8-beta.67', '2.0'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:foo',
|
|
|
|
'org/app:2.0.8-beta.67',
|
|
|
|
'org/app:2.0',
|
|
|
|
'ghcr.io/user/app:foo',
|
|
|
|
'ghcr.io/user/app:2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:2.0'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag16',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,priority=2000,foo`,
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=edge`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo',
|
|
|
|
partial: ['v1.1.1'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:foo',
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/user/app:foo',
|
|
|
|
'ghcr.io/user/app:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2021-04-05 21:19:05 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag17',
|
|
|
|
'event_tag_p1-v1.0.0.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,"pattern=/^v(\\d.\\d.\\d)$/ig",group=1`,
|
|
|
|
`type=match,pattern=\\d.\\d.\\d`,
|
|
|
|
`type=match,pattern=\\d.\\d`,
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['1.0', 'sha-860c190'],
|
2021-04-05 21:19:05 +02:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.0',
|
|
|
|
'org/app:1.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190',
|
2021-04-05 21:19:05 +02:00
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.0.0',
|
|
|
|
'ghcr.io/user/app:1.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190',
|
2021-04-05 21:19:05 +02:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-04-05 21:19:05 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag18',
|
|
|
|
'event_tag_p1-v1.0.0.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
2022-05-04 15:02:20 +02:00
|
|
|
`type=match,pattern=p1/v(\\d.\\d.\\d),group=1`,
|
|
|
|
`type=match,pattern=p1/v(\\d.\\d),group=1`,
|
|
|
|
`type=match,pattern=p1/v(\\d.\\d),group=3`,
|
2021-04-05 21:19:05 +02:00
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['1.0', 'sha-860c190'],
|
2021-04-05 21:19:05 +02:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.0',
|
|
|
|
'org/app:1.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190',
|
2021-04-05 21:19:05 +02:00
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.0.0',
|
|
|
|
'ghcr.io/user/app:1.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190',
|
2021-04-05 21:19:05 +02:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-04-05 21:19:05 +02:00
|
|
|
]
|
2021-04-07 20:54:35 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag19',
|
|
|
|
'event_tag_p1-v1.0.0.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
2022-05-04 15:02:20 +02:00
|
|
|
`type=match,pattern=p1/v(\\d.\\d.\\d),group=1`,
|
|
|
|
`type=match,pattern=p1/v(\\d.\\d),group=1,suffix=`,
|
2021-04-07 20:54:35 +02:00
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`suffix=-dev`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.0-dev',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['1.0', 'sha-860c190-dev'],
|
2021-04-07 20:54:35 +02:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.0-dev',
|
|
|
|
'org/app:1.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190-dev',
|
2021-04-07 20:54:35 +02:00
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.0.0-dev',
|
|
|
|
'ghcr.io/user/app:1.0',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190-dev',
|
2021-04-07 20:54:35 +02:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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-dev"
|
2021-04-07 20:54:35 +02:00
|
|
|
]
|
2021-05-07 21:53:30 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag20',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
2021-10-22 13:14:38 +02:00
|
|
|
`type=raw,{{tag}}-{{sha}}-foo`,
|
2022-04-25 13:41:39 +02:00
|
|
|
`type=raw,{{base_ref}}-foo`,
|
|
|
|
`type=raw,defbranch-foo,enable={{is_default_branch}}`
|
2021-05-07 21:53:30 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'v1.1.1-860c190-foo',
|
2021-10-22 13:14:38 +02:00
|
|
|
partial: [
|
2022-04-26 14:47:46 +02:00
|
|
|
'master-foo'
|
2021-10-22 13:14:38 +02:00
|
|
|
],
|
2021-05-07 21:53:30 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:v1.1.1-860c190-foo',
|
2021-10-22 13:14:38 +02:00
|
|
|
'org/app:master-foo',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:v1.1.1-860c190-foo',
|
2022-04-26 14:47:46 +02:00
|
|
|
'ghcr.io/user/app:master-foo'
|
2021-05-07 21:53:30 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1-860c190-foo"
|
2021-05-07 21:53:30 +02:00
|
|
|
]
|
2021-07-05 20:37:02 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag21',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}.{{patch}}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`suffix=-dev,onlatest=true`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1-dev',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1-dev',
|
|
|
|
'org/app:latest-dev',
|
|
|
|
'ghcr.io/user/app:1.1.1-dev',
|
|
|
|
'ghcr.io/user/app:latest-dev'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1-dev"
|
2021-07-05 20:37:02 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag22',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}.{{patch}}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=foo-,onlatest=true`,
|
|
|
|
`suffix=-dev,onlatest=true`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo-1.1.1-dev',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:foo-1.1.1-dev',
|
|
|
|
'org/app:foo-latest-dev',
|
|
|
|
'ghcr.io/user/app:foo-1.1.1-dev',
|
|
|
|
'ghcr.io/user/app:foo-latest-dev'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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-1.1.1-dev"
|
2021-07-05 20:37:02 +02:00
|
|
|
]
|
|
|
|
],
|
2021-07-06 13:56:48 +02:00
|
|
|
[
|
|
|
|
'tag23',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
2021-07-12 17:08:07 +02:00
|
|
|
`type=pep440,pattern={{raw}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2021-07-12 17:08:07 +02:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: ['1.1'],
|
2021-07-06 13:56:48 +02:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
2021-07-12 17:08:07 +02:00
|
|
|
'org/app:v1.1.1',
|
2021-07-06 13:56:48 +02:00
|
|
|
'org/app:1.1',
|
|
|
|
'org/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag24',
|
|
|
|
'event_tag_1.2.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{version}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.2',
|
|
|
|
partial: [],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.2',
|
|
|
|
'org/app:latest',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag25',
|
|
|
|
'event_tag_1.1beta2.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=pep440,pattern={{major}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1b2',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1b2',
|
|
|
|
'ghcr.io/user/app:1.1b2'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1b2"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag26',
|
|
|
|
'event_tag_1.0dev4.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=pep440,pattern={{major}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.0.dev4',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.0.dev4',
|
|
|
|
'ghcr.io/user/app:1.0.dev4'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.dev4"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag27',
|
|
|
|
'event_tag_1.2.3rc2.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{raw}}`,
|
|
|
|
`type=pep440,pattern={{version}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=pep440,pattern={{major}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.2.3rc2',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.2.3rc2',
|
|
|
|
'ghcr.io/user/app:1.2.3rc2'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.3rc2"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag28',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{version}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}.{{patch}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=pep440,pattern={{major}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: [
|
|
|
|
"1.1",
|
|
|
|
"1"
|
|
|
|
],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:1.1',
|
|
|
|
'org/app:1',
|
|
|
|
'org/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag29',
|
|
|
|
'event_tag_1.2post1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{version}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=pep440,pattern={{major}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.2.post1',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.2.post1'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.post1"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'tag30',
|
|
|
|
'event_tag_sometag.env',
|
|
|
|
{
|
|
|
|
images: ['ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=pep440,pattern={{version}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=pep440,pattern={{major}}`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sometag',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'ghcr.io/user/app:sometag'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sometag"
|
2021-07-06 13:56:48 +02:00
|
|
|
]
|
|
|
|
],
|
2021-12-06 15:40:44 +01:00
|
|
|
[
|
|
|
|
'tag31',
|
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{raw}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v2.0.8-beta.67',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v2.0.8-beta.67',
|
|
|
|
'ghcr.io/user/app:v2.0.8-beta.67'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v2.0.8-beta.67"
|
2021-12-06 15:40:44 +01:00
|
|
|
]
|
|
|
|
],
|
2021-12-06 17:15:06 +01:00
|
|
|
[
|
|
|
|
'tag32',
|
|
|
|
'event_tag_v1.2.3rc2.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=pep440,pattern={{raw}}`,
|
|
|
|
`type=pep440,pattern={{major}}.{{minor}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.2.3rc2',
|
|
|
|
partial: ['1.2.3rc2'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.2.3rc2',
|
|
|
|
'org/app:1.2.3rc2',
|
|
|
|
'ghcr.io/user/app:v1.2.3rc2',
|
|
|
|
'ghcr.io/user/app:1.2.3rc2'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.2.3rc2"
|
2021-12-06 17:15:06 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
2020-10-26 17:51:00 +01:00
|
|
|
describe('latest', () => {
|
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-26 17:51:00 +01:00
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest01',
|
2020-10-26 17:51:00 +01:00
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,"pattern=^release\\d{1,2}"`
|
|
|
|
],
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'release1',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01:00
|
|
|
latest: true,
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:release1',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=release1"
|
2020-10-26 17:51:00 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest02',
|
2020-10-26 17:51:00 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,"pattern=^\\d+-RC\\d{1,2}"`
|
|
|
|
]
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110-RC2',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110-RC2',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110-RC2"
|
2020-10-26 17:51:00 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest03',
|
2020-10-26 17:51:00 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`
|
|
|
|
]
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110"
|
2020-10-26 17:51:00 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest04',
|
2020-10-26 17:51:00 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '1.1.1',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:1.1.1',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-10-26 17:51:00 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest05',
|
2020-10-26 17:51:00 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Version,
|
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'org/app:v1.1.1',
|
2020-10-28 18:25:31 +01:00
|
|
|
'org/app:latest',
|
2020-10-27 00:57:32 +01:00
|
|
|
'ghcr.io/user/app:v1.1.1',
|
2020-10-28 18:25:31 +01:00
|
|
|
'ghcr.io/user/app:latest',
|
2020-10-26 17:51:00 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1"
|
2020-10-26 17:51:00 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest06',
|
2020-10-26 17:51:00 +01:00
|
|
|
'event_tag_v2.0.8-beta.67.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
2021-04-03 18:15:27 +02:00
|
|
|
`type=match,"pattern=\\d.\\d.\\d"`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-10-26 17:51:00 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '2.0.8',
|
|
|
|
partial: [],
|
2020-10-26 17:51:00 +01:00
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'org/app:2.0.8',
|
2020-10-26 17:51:00 +01:00
|
|
|
'org/app:latest',
|
2020-10-27 00:57:32 +01:00
|
|
|
'ghcr.io/user/app:2.0.8',
|
2020-10-26 17:51:00 +01:00
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=2.0.8"
|
2020-10-26 17:51:00 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-31 19:52:55 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest07',
|
2020-10-31 19:52:55 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-10-31 19:52:55 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-31 19:52:55 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/user/app:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1"
|
2020-11-20 16:30:57 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest08',
|
2020-11-20 16:30:57 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/MyUSER/MyApp'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-11-20 16:30:57 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/myuser/myapp:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1"
|
2020-10-31 19:52:55 +01:00
|
|
|
]
|
|
|
|
],
|
2020-12-23 22:09:38 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'latest09',
|
2020-12-23 22:09:38 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/MyUSER/MyApp'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
],
|
|
|
|
labels: [
|
2020-12-23 22:09:38 +01:00
|
|
|
"maintainer=CrazyMax",
|
2021-11-29 13:31:50 +01:00
|
|
|
`org.opencontainers.image.description=this is a "good" example`,
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.title=MyCustomTitle",
|
2020-12-23 22:09:38 +01:00
|
|
|
"org.opencontainers.image.vendor=MyCompany",
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2020-12-23 22:09:38 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:v1.1.1',
|
|
|
|
'ghcr.io/myuser/myapp:v1.1.1',
|
|
|
|
],
|
|
|
|
[
|
2023-06-13 02:31:02 +02:00
|
|
|
"maintainer=CrazyMax",
|
2020-12-23 22:09:38 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
`org.opencontainers.image.description=this is a "good" example`,
|
2020-12-23 22:09:38 +01:00
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
|
|
|
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
|
2020-12-23 22:09:38 +01:00
|
|
|
"org.opencontainers.image.title=MyCustomTitle",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
|
|
|
|
"org.opencontainers.image.vendor=MyCompany",
|
|
|
|
"org.opencontainers.image.version=v1.1.1"
|
2020-12-23 22:09:38 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 17:51:00 +01:00
|
|
|
});
|
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
describe('pr', () => {
|
2022-10-17 11:49:09 +02:00
|
|
|
// prettier-ignore
|
|
|
|
// eslint-disable-next-line jest/expect-expect
|
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'pr01',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'pr-15',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:pr-15'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr02',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'pr-15',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:pr-15',
|
|
|
|
'ghcr.io/user/app:pr-15'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr03',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'pr-15',
|
|
|
|
partial: ['sha-a9c8c58'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:pr-15',
|
|
|
|
'org/app:sha-a9c8c58',
|
|
|
|
'ghcr.io/user/app:pr-15',
|
|
|
|
'ghcr.io/user/app:sha-a9c8c58'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr04',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=sha,priority=2000`,
|
|
|
|
`type=ref,event=pr`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sha-a9c8c58',
|
|
|
|
partial: ['pr-15'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:sha-a9c8c58',
|
|
|
|
'org/app:pr-15',
|
|
|
|
'ghcr.io/user/app:sha-a9c8c58',
|
|
|
|
'ghcr.io/user/app:pr-15'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-a9c8c58"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr05',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'pr-15-bal',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:pr-15-bal',
|
|
|
|
'ghcr.io/user/app:pr-15-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15-bal"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr06',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr,prefix=`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '15-bal',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:15-bal',
|
|
|
|
'ghcr.io/user/app:15-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=15-bal"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr07',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=sha,priority=2000`,
|
|
|
|
`type=ref,event=pr`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'sha-2665741',
|
|
|
|
partial: ['pr-15'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:sha-2665741',
|
|
|
|
'org/app:pr-15',
|
|
|
|
'ghcr.io/user/app:sha-2665741',
|
|
|
|
'ghcr.io/user/app:pr-15'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-2665741"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr08',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr,prefix=`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '15-bal',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:15-bal',
|
|
|
|
'ghcr.io/user/app:15-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=15-bal"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr09',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=sha`,
|
|
|
|
`type=sha,format=long`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'pr-15',
|
|
|
|
partial: [
|
|
|
|
'sha-2665741',
|
|
|
|
'sha-266574110acf203503badf966df2ea24b5d732d7'
|
|
|
|
],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:pr-15',
|
|
|
|
'org/app:sha-2665741',
|
|
|
|
'org/app:sha-266574110acf203503badf966df2ea24b5d732d7'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr10',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,value=mytag-{{base_ref}}`,
|
|
|
|
`type=raw,mytag-defbranch,enable={{is_default_branch}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'mytag-master',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:mytag-master'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=266574110acf203503badf966df2ea24b5d732d7",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=mytag-master"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr11',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,value=mytag-{{base_ref}}`,
|
|
|
|
`type=raw,mytag-defbranch,enable={{is_default_branch}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'mytag-master',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:mytag-master'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-17 11:49:09 +02:00
|
|
|
"org.opencontainers.image.revision=a9c8c5828b91be19d9728548b24759e352367ef1",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=mytag-master"
|
2022-10-17 11:49:09 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('pr-head-sha', () => {
|
2020-10-26 01:39:21 +01:00
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-26 01:39:21 +01:00
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'pr01',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'pr-15',
|
2020-11-17 23:31:03 +01:00
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'user/app:pr-15'
|
2020-10-26 01:39:21 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2020-10-26 01:39:21 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'pr02',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'pr-15',
|
2020-11-17 23:31:03 +01:00
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:pr-15',
|
|
|
|
'ghcr.io/user/app:pr-15'
|
2020-10-26 01:39:21 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2020-10-26 01:39:21 +01:00
|
|
|
]
|
|
|
|
],
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'pr03',
|
2020-10-25 02:25:23 +01:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'pr-15',
|
2022-10-08 00:17:03 +02:00
|
|
|
partial: ['sha-3370e22'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:pr-15',
|
2022-10-08 00:17:03 +02:00
|
|
|
'org/app:sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:pr-15',
|
2022-10-08 00:17:03 +02:00
|
|
|
'ghcr.io/user/app:sha-3370e22'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
[
|
|
|
|
'pr04',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=sha,priority=2000`,
|
|
|
|
`type=ref,event=pr`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-10-08 00:17:03 +02:00
|
|
|
main: 'sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['pr-15'],
|
2021-03-29 13:04:53 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-10-08 00:17:03 +02:00
|
|
|
'org/app:sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:pr-15',
|
2022-10-08 00:17:03 +02:00
|
|
|
'ghcr.io/user/app:sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:pr-15'
|
2021-03-29 13:04:53 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-3370e22"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
2021-04-07 20:31:35 +02:00
|
|
|
[
|
|
|
|
'pr05',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'pr-15-bal',
|
2021-04-07 20:31:35 +02:00
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:pr-15-bal',
|
|
|
|
'ghcr.io/user/app:pr-15-bal'
|
2021-04-07 20:31:35 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15-bal"
|
2021-04-07 20:31:35 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr06',
|
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr,prefix=`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: '15-bal',
|
2021-04-07 20:31:35 +02:00
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:15-bal',
|
|
|
|
'ghcr.io/user/app:15-bal'
|
2021-04-07 20:31:35 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=15-bal"
|
2021-04-07 20:31:35 +02:00
|
|
|
]
|
2021-05-23 03:54:23 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr07',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=sha,priority=2000`,
|
|
|
|
`type=ref,event=pr`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-10-08 00:17:03 +02:00
|
|
|
main: 'sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['pr-15'],
|
2021-05-23 03:54:23 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-10-08 00:17:03 +02:00
|
|
|
'org/app:sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:pr-15',
|
2022-10-08 00:17:03 +02:00
|
|
|
'ghcr.io/user/app:sha-3370e22',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:pr-15'
|
2021-05-23 03:54:23 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-3370e22"
|
2021-05-23 03:54:23 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr08',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=pr,prefix=`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: '15-bal',
|
2021-05-23 03:54:23 +02:00
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:15-bal',
|
|
|
|
'ghcr.io/user/app:15-bal'
|
2021-05-23 03:54:23 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=15-bal"
|
2021-05-23 03:54:23 +02:00
|
|
|
]
|
2021-05-25 18:45:23 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr09',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=ref,event=pr`,
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=sha`,
|
|
|
|
`type=sha,format=long`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'pr-15',
|
2021-05-25 18:45:23 +02:00
|
|
|
partial: [
|
2022-10-08 00:17:03 +02:00
|
|
|
'sha-3370e22',
|
|
|
|
'sha-3370e228f2209994d57af4427fe64e71bb79ac96'
|
2021-05-25 18:45:23 +02:00
|
|
|
],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:pr-15',
|
2022-10-08 00:17:03 +02:00
|
|
|
'org/app:sha-3370e22',
|
|
|
|
'org/app:sha-3370e228f2209994d57af4427fe64e71bb79ac96'
|
2021-05-25 18:45:23 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=pr-15"
|
2021-05-25 18:45:23 +02:00
|
|
|
]
|
2021-10-22 13:14:38 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'pr10',
|
|
|
|
'event_pull_request_target.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,value=mytag-{{base_ref}}`,
|
2022-04-25 13:41:39 +02:00
|
|
|
`type=raw,mytag-defbranch,enable={{is_default_branch}}`
|
2021-10-22 13:14:38 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'mytag-master',
|
2022-04-26 17:13:40 +02:00
|
|
|
partial: [],
|
2021-10-22 13:14:38 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-26 17:13:40 +02:00
|
|
|
'org/app:mytag-master'
|
2021-10-22 13:14:38 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=mytag-master"
|
2021-10-22 13:14:38 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2022-04-25 13:41:39 +02:00
|
|
|
'pr11',
|
2021-10-22 13:14:38 +02:00
|
|
|
'event_pull_request.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,value=mytag-{{base_ref}}`,
|
2022-04-25 13:41:39 +02:00
|
|
|
`type=raw,mytag-defbranch,enable={{is_default_branch}}`
|
2021-10-22 13:14:38 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'mytag-master',
|
2022-04-26 17:13:40 +02:00
|
|
|
partial: [],
|
2021-10-22 13:14:38 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-26 17:13:40 +02:00
|
|
|
'org/app:mytag-master'
|
2021-10-22 13:14:38 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-10-08 00:17:03 +02:00
|
|
|
"org.opencontainers.image.revision=3370e228f2209994d57af4427fe64e71bb79ac96",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=mytag-master"
|
2021-10-22 13:14:38 +02:00
|
|
|
]
|
|
|
|
],
|
2022-10-17 11:49:09 +02:00
|
|
|
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exVersion: Version, exTags: Array<string>, exLabels: Array<string>) => {
|
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
|
|
|
process.env.DOCKER_METADATA_PR_HEAD_SHA = 'true';
|
|
|
|
|
2023-02-20 22:32:55 +01:00
|
|
|
const toolkit = new Toolkit();
|
|
|
|
const repo = await toolkit.github.repoData();
|
2023-04-17 04:42:21 +02:00
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
|
2022-10-17 11:49:09 +02:00
|
|
|
|
|
|
|
const version = meta.version;
|
|
|
|
expect(version).toEqual(exVersion);
|
|
|
|
|
|
|
|
const tags = meta.getTags();
|
|
|
|
expect(tags).toEqual(exTags);
|
|
|
|
|
|
|
|
const labels = meta.getLabels();
|
|
|
|
expect(labels).toEqual(exLabels);
|
|
|
|
});
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('schedule', () => {
|
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-26 01:39:21 +01:00
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'schedule01',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'nightly',
|
2021-03-29 13:04:53 +02:00
|
|
|
partial: ['master'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'user/app:nightly',
|
|
|
|
'user/app:master'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=nightly"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'schedule02',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=schedule,pattern={{date 'YYYYMMDD'}}`
|
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:20200110'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'schedule03',
|
2020-10-25 02:25:23 +01:00
|
|
|
'event_schedule.env',
|
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=schedule,pattern={{date 'YYYYMMDD-HHmmss'}}`
|
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: '20200110-003000',
|
|
|
|
partial: [],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'user/app:20200110-003000'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110-003000"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'schedule04',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'nightly',
|
2021-03-29 13:04:53 +02:00
|
|
|
partial: ['master'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:nightly',
|
2021-03-29 13:04:53 +02:00
|
|
|
'org/app:master',
|
|
|
|
'ghcr.io/user/app:nightly',
|
|
|
|
'ghcr.io/user/app:master'
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=nightly"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'schedule05',
|
2020-10-26 01:39:21 +01:00
|
|
|
'event_schedule.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=schedule`,
|
|
|
|
`type=sha`
|
|
|
|
]
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'nightly',
|
2022-04-19 13:18:06 +02:00
|
|
|
partial: ['sha-860c190'],
|
2020-10-26 01:39:21 +01:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-26 01:39:21 +01:00
|
|
|
'org/app:nightly',
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190',
|
2020-10-26 01:39:21 +01:00
|
|
|
'ghcr.io/user/app:nightly',
|
2023-06-13 02:31:02 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190'
|
|
|
|
],
|
|
|
|
[
|
2020-10-25 02:25:23 +01:00
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=nightly"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
[
|
|
|
|
'schedule06',
|
|
|
|
'event_schedule.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=schedule`,
|
2022-04-25 13:41:39 +02:00
|
|
|
`type=sha,priority=2000`,
|
|
|
|
`type=raw,value=defbranch,enable={{is_default_branch}}`
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
2022-04-19 13:18:06 +02:00
|
|
|
main: 'sha-860c190',
|
2022-04-25 13:41:39 +02:00
|
|
|
partial: [
|
|
|
|
'nightly',
|
|
|
|
'defbranch'
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
2022-04-19 13:18:06 +02:00
|
|
|
'org/app:sha-860c190',
|
2021-03-29 13:04:53 +02:00
|
|
|
'org/app:nightly',
|
2022-04-25 13:41:39 +02:00
|
|
|
'org/app:defbranch',
|
2022-04-19 13:18:06 +02:00
|
|
|
'ghcr.io/user/app:sha-860c190',
|
2022-04-25 13:41:39 +02:00
|
|
|
'ghcr.io/user/app:nightly',
|
|
|
|
'ghcr.io/user/app:defbranch'
|
2021-03-29 13:04:53 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=sha-860c190"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
2021-04-07 20:31:35 +02:00
|
|
|
[
|
|
|
|
'schedule07',
|
|
|
|
'event_schedule.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=schedule`,
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'glo-nightly-bal',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:glo-nightly-bal',
|
|
|
|
'ghcr.io/user/app:glo-nightly-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=glo-nightly-bal"
|
2021-04-07 20:31:35 +02:00
|
|
|
]
|
|
|
|
],
|
2022-12-29 01:01:17 +01:00
|
|
|
[
|
|
|
|
'schedule08',
|
|
|
|
'event_schedule.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=schedule,pattern={{date 'YYYYMMDD-HHmmss' tz='Asia/Tokyo'}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '20200110-093000',
|
|
|
|
partial: [],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110-093000'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-12-29 01:01:17 +01:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110-093000"
|
2022-12-29 01:01:17 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %p with %p event', tagsLabelsTest);
|
2020-10-26 01:39:21 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
describe('release', () => {
|
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-10-26 01:39:21 +01:00
|
|
|
test.each([
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'release01',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_release_created.env',
|
2020-10-25 02:25:23 +01:00
|
|
|
{
|
2020-10-26 01:39:21 +01:00
|
|
|
images: ['user/app'],
|
2020-10-25 15:13:43 +01:00
|
|
|
} as Inputs,
|
2020-10-26 01:39:21 +01:00
|
|
|
{
|
2020-11-17 23:31:03 +01:00
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [],
|
2020-10-28 18:25:31 +01:00
|
|
|
latest: true
|
2020-10-26 01:39:21 +01:00
|
|
|
} as Version,
|
2020-10-25 02:25:23 +01:00
|
|
|
[
|
2020-10-27 00:57:32 +01:00
|
|
|
'user/app:v1.1.1',
|
2020-10-28 18:25:31 +01:00
|
|
|
'user/app:latest',
|
2020-10-25 02:25:23 +01:00
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1"
|
2020-10-25 02:25:23 +01:00
|
|
|
]
|
|
|
|
],
|
2022-04-25 13:41:39 +02:00
|
|
|
[
|
|
|
|
'release02',
|
|
|
|
'event_release_created.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=raw,value=baseref-{{base_ref}}`,
|
|
|
|
`type=raw,value=defbranch,enable={{is_default_branch}}`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'v1.1.1',
|
|
|
|
partial: [
|
|
|
|
'baseref-'
|
|
|
|
],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:v1.1.1',
|
|
|
|
'user/app:baseref-',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-25 13:41:39 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=v1.1.1"
|
2022-04-25 13:41:39 +02:00
|
|
|
]
|
|
|
|
]
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %s with %p event', tagsLabelsTest);
|
2020-10-25 02:25:23 +01:00
|
|
|
});
|
2020-12-04 18:12:39 +01:00
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
describe('raw', () => {
|
2020-12-04 18:12:39 +01:00
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-12-04 18:12:39 +01:00
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'raw01',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-12-04 18:12:39 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-04 18:12:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'dev',
|
|
|
|
partial: ['my', 'custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:dev',
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=dev"
|
2020-12-04 18:12:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'raw02',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-12-04 18:12:39 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`
|
|
|
|
]
|
2020-12-04 18:12:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'dev',
|
|
|
|
partial: ['my'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:dev',
|
|
|
|
'user/app:my'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=dev"
|
2020-12-04 18:12:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'raw03',
|
2020-12-04 18:12:39 +01:00
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-04 18:12:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'release1',
|
|
|
|
partial: ['my', 'custom', 'tags'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:release1',
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=release1"
|
2020-12-04 18:12:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'raw04',
|
2020-12-04 18:12:39 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-12-04 18:12:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '20200110',
|
|
|
|
partial: ['my', 'custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:20200110',
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=20200110"
|
2020-12-04 18:12:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'raw05',
|
2020-12-04 18:12:39 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-04 18:12:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: '1.1.1',
|
|
|
|
partial: ['1.1', '1', 'my', 'custom', 'tags'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:1.1.1',
|
|
|
|
'org/app:1.1',
|
|
|
|
'org/app:1',
|
|
|
|
'org/app:my',
|
|
|
|
'org/app:custom',
|
|
|
|
'org/app:tags',
|
|
|
|
'org/app:latest',
|
|
|
|
'ghcr.io/user/app:1.1.1',
|
|
|
|
'ghcr.io/user/app:1.1',
|
|
|
|
'ghcr.io/user/app:1',
|
|
|
|
'ghcr.io/user/app:my',
|
|
|
|
'ghcr.io/user/app:custom',
|
|
|
|
'ghcr.io/user/app:tags',
|
|
|
|
'ghcr.io/user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-12-04 18:12:39 +01:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'raw06',
|
2020-12-04 18:12:39 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-04 18:12:39 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my',
|
|
|
|
partial: ['custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'org/app:my',
|
|
|
|
'org/app:custom',
|
|
|
|
'org/app:tags',
|
|
|
|
'ghcr.io/user/app:my',
|
|
|
|
'ghcr.io/user/app:custom',
|
|
|
|
'ghcr.io/user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=my"
|
2020-12-04 18:12:39 +01:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
[
|
|
|
|
'raw07',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-03-29 13:04:53 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,priority=90,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=true`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my',
|
|
|
|
partial: ['custom', 'tags', 'dev'],
|
|
|
|
latest: true
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags',
|
|
|
|
'user/app:dev',
|
|
|
|
'user/app:latest'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=my"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'raw08',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-03-29 13:04:53 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'my',
|
|
|
|
partial: ['custom', 'tags'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:my',
|
|
|
|
'user/app:custom',
|
|
|
|
'user/app:tags'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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=my"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'raw09',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-03-29 13:04:53 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my,prefix=foo-,suffix=-bar`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`,
|
|
|
|
`prefix=glo-`,
|
|
|
|
`suffix=-bal`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo-my-bar',
|
|
|
|
partial: ['glo-custom-bal', 'glo-tags-bal'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:foo-my-bar',
|
|
|
|
'user/app:glo-custom-bal',
|
|
|
|
'user/app:glo-tags-bal'
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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-my-bar"
|
2021-03-29 13:04:53 +02:00
|
|
|
]
|
2021-03-30 13:11:51 +02:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'raw10',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-03-30 13:11:51 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,foo`,
|
|
|
|
`type=raw,bar,enable=false`,
|
|
|
|
`type=raw,baz,enable=true`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
main: 'foo',
|
|
|
|
partial: ['baz'],
|
|
|
|
latest: false
|
|
|
|
} as Version,
|
|
|
|
[
|
|
|
|
'user/app:foo',
|
|
|
|
'user/app:baz',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description=This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses=MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision=860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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"
|
2021-03-30 13:11:51 +02:00
|
|
|
]
|
|
|
|
],
|
2021-03-29 13:04:53 +02:00
|
|
|
])('given %p wth %p event', tagsLabelsTest);
|
2020-12-04 18:12:39 +01:00
|
|
|
});
|
2020-12-24 04:13:41 +01:00
|
|
|
|
2021-05-22 21:23:06 +02:00
|
|
|
describe('json', () => {
|
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2021-05-22 21:23:06 +02:00
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'json01',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-05-22 21:23:06 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
labels: [
|
2023-06-13 02:31:02 +02:00
|
|
|
"invalid",
|
|
|
|
"foo="
|
2021-05-22 21:23:06 +02:00
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"user/app:dev",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
2023-06-13 02:31:02 +02:00
|
|
|
"foo": "",
|
2021-05-22 21:23:06 +02:00
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "dev"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'json02',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2021-05-22 21:23:06 +02:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"user/app:dev",
|
|
|
|
"user/app:my",
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "dev"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'json03',
|
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
bakeTarget: "meta"
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"user/app:release1",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags",
|
|
|
|
"user/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "release1"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'json04',
|
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"user/app:20200110",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "20200110"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'json05',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"org/app:1.1.1",
|
|
|
|
"org/app:1.1",
|
|
|
|
"org/app:1",
|
|
|
|
"org/app:my",
|
|
|
|
"org/app:custom",
|
|
|
|
"org/app:tags",
|
|
|
|
"org/app:latest",
|
|
|
|
"ghcr.io/user/app:1.1.1",
|
|
|
|
"ghcr.io/user/app:1.1",
|
|
|
|
"ghcr.io/user/app:1",
|
|
|
|
"ghcr.io/user/app:my",
|
|
|
|
"ghcr.io/user/app:custom",
|
|
|
|
"ghcr.io/user/app:tags",
|
|
|
|
"ghcr.io/user/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'json06',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"org/app:my",
|
|
|
|
"org/app:custom",
|
|
|
|
"org/app:tags",
|
|
|
|
"ghcr.io/user/app:my",
|
|
|
|
"ghcr.io/user/app:custom",
|
|
|
|
"ghcr.io/user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "my"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'json07',
|
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
|
|
|
labels: [
|
|
|
|
"foo",
|
|
|
|
"maintainer=CrazyMax",
|
|
|
|
"org.opencontainers.image.title=MyCustom=Title",
|
|
|
|
"org.opencontainers.image.description=Another description",
|
|
|
|
"org.opencontainers.image.vendor=MyCompany",
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"tags": [
|
|
|
|
"org/app:v1.1.1",
|
|
|
|
"org/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"maintainer": "CrazyMax",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2021-05-22 21:23:06 +02:00
|
|
|
"org.opencontainers.image.description": "Another description",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2021-05-22 21:23:06 +02:00
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.title": "MyCustom=Title",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
2021-05-22 21:23:06 +02:00
|
|
|
"org.opencontainers.image.vendor": "MyCompany",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.version": "v1.1.1"
|
2021-05-22 21:23:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2022-03-22 21:09:00 +01:00
|
|
|
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exJSON: unknown) => {
|
2021-05-22 21:23:06 +02:00
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
|
|
|
|
2023-02-20 22:32:55 +01:00
|
|
|
const toolkit = new Toolkit();
|
|
|
|
const repo = await toolkit.github.repoData();
|
2023-04-17 04:42:21 +02:00
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
|
2021-05-22 21:23:06 +02:00
|
|
|
|
|
|
|
const jsonOutput = meta.getJSON();
|
|
|
|
expect(jsonOutput).toEqual(exJSON);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
describe('bake', () => {
|
2020-12-24 04:13:41 +01:00
|
|
|
// prettier-ignore
|
2022-10-07 22:45:46 +02:00
|
|
|
// eslint-disable-next-line jest/expect-expect
|
2020-12-24 04:13:41 +01:00
|
|
|
test.each([
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake01',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-12-24 04:13:41 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
labels: [
|
|
|
|
"invalid"
|
|
|
|
]
|
2020-12-24 04:13:41 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-05-10 15:54:35 +02:00
|
|
|
"docker-metadata-action": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"user/app:dev",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "dev"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "dev",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake02',
|
2022-04-19 13:18:06 +02:00
|
|
|
'event_push_dev.env',
|
2020-12-24 04:13:41 +01:00
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`
|
|
|
|
]
|
2020-12-24 04:13:41 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-05-10 15:54:35 +02:00
|
|
|
"docker-metadata-action": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"user/app:dev",
|
|
|
|
"user/app:my",
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "dev"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "dev",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake03',
|
2020-12-24 04:13:41 +01:00
|
|
|
'event_tag_release1.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=ref,event=tag`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
2021-04-30 00:51:48 +02:00
|
|
|
],
|
|
|
|
bakeTarget: "meta"
|
2020-12-24 04:13:41 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-04-30 00:51:48 +02:00
|
|
|
"meta": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"user/app:release1",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags",
|
|
|
|
"user/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "release1"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "release1",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake04',
|
2020-12-24 04:13:41 +01:00
|
|
|
'event_tag_20200110-RC2.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=match,pattern=\\d{8}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
flavor: [
|
|
|
|
`latest=false`
|
|
|
|
]
|
2020-12-24 04:13:41 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-05-10 15:54:35 +02:00
|
|
|
"docker-metadata-action": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"user/app:20200110",
|
|
|
|
"user/app:my",
|
|
|
|
"user/app:custom",
|
|
|
|
"user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "20200110"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "user/app",
|
|
|
|
"DOCKER_META_VERSION": "20200110",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake05',
|
2020-12-24 04:13:41 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=semver,pattern={{version}}`,
|
|
|
|
`type=semver,pattern={{major}}.{{minor}}`,
|
|
|
|
`type=semver,pattern={{major}}`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-24 04:13:41 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-05-10 15:54:35 +02:00
|
|
|
"docker-metadata-action": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"org/app:1.1.1",
|
|
|
|
"org/app:1.1",
|
|
|
|
"org/app:1",
|
|
|
|
"org/app:my",
|
|
|
|
"org/app:custom",
|
|
|
|
"org/app:tags",
|
|
|
|
"org/app:latest",
|
|
|
|
"ghcr.io/user/app:1.1.1",
|
|
|
|
"ghcr.io/user/app:1.1",
|
|
|
|
"ghcr.io/user/app:1",
|
|
|
|
"ghcr.io/user/app:my",
|
|
|
|
"ghcr.io/user/app:custom",
|
|
|
|
"ghcr.io/user/app:tags",
|
|
|
|
"ghcr.io/user/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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.1.1"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "org/app,ghcr.io/user/app",
|
|
|
|
"DOCKER_META_VERSION": "1.1.1",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake06',
|
2020-12-24 04:13:41 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app', 'ghcr.io/user/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
tags: [
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
]
|
2020-12-24 04:13:41 +01:00
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-05-10 15:54:35 +02:00
|
|
|
"docker-metadata-action": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"org/app:my",
|
|
|
|
"org/app:custom",
|
|
|
|
"org/app:tags",
|
|
|
|
"ghcr.io/user/app:my",
|
|
|
|
"ghcr.io/user/app:custom",
|
|
|
|
"ghcr.io/user/app:tags"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.description": "This your first repo!",
|
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
2022-04-19 13:18:06 +02:00
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2023-06-13 02:31:02 +02:00
|
|
|
"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": "my"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "org/app,ghcr.io/user/app",
|
|
|
|
"DOCKER_META_VERSION": "my",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
[
|
2021-03-29 13:04:53 +02:00
|
|
|
'bake07',
|
2020-12-24 04:13:41 +01:00
|
|
|
'event_tag_v1.1.1.env',
|
|
|
|
{
|
|
|
|
images: ['org/app'],
|
2021-03-29 13:04:53 +02:00
|
|
|
labels: [
|
2020-12-24 04:13:41 +01:00
|
|
|
"maintainer=CrazyMax",
|
|
|
|
"org.opencontainers.image.title=MyCustom=Title",
|
|
|
|
"org.opencontainers.image.description=Another description",
|
|
|
|
"org.opencontainers.image.vendor=MyCompany",
|
|
|
|
],
|
|
|
|
} as Inputs,
|
|
|
|
{
|
|
|
|
"target": {
|
2021-05-10 15:54:35 +02:00
|
|
|
"docker-metadata-action": {
|
2020-12-24 04:13:41 +01:00
|
|
|
"tags": [
|
|
|
|
"org/app:v1.1.1",
|
|
|
|
"org/app:latest"
|
|
|
|
],
|
|
|
|
"labels": {
|
|
|
|
"maintainer": "CrazyMax",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.created": "2020-01-10T00:30:00.000Z",
|
2020-12-24 04:13:41 +01:00
|
|
|
"org.opencontainers.image.description": "Another description",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.licenses": "MIT",
|
|
|
|
"org.opencontainers.image.revision": "860c1904a1ce19322e91ac35af1ab07466440c37",
|
2020-12-24 04:13:41 +01:00
|
|
|
"org.opencontainers.image.source": "https://github.com/octocat/Hello-World",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.title": "MyCustom=Title",
|
|
|
|
"org.opencontainers.image.url": "https://github.com/octocat/Hello-World",
|
2020-12-24 04:13:41 +01:00
|
|
|
"org.opencontainers.image.vendor": "MyCompany",
|
2023-06-13 02:31:02 +02:00
|
|
|
"org.opencontainers.image.version": "v1.1.1"
|
2020-12-24 16:45:28 +01:00
|
|
|
},
|
|
|
|
"args": {
|
|
|
|
"DOCKER_META_IMAGES": "org/app",
|
|
|
|
"DOCKER_META_VERSION": "v1.1.1",
|
2020-12-24 04:13:41 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2022-03-22 21:09:00 +01:00
|
|
|
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, exBakeDefinition: unknown) => {
|
2020-12-24 04:13:41 +01:00
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
|
|
|
|
2023-02-20 22:32:55 +01:00
|
|
|
const toolkit = new Toolkit();
|
|
|
|
const repo = await toolkit.github.repoData();
|
2023-04-17 04:42:21 +02:00
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
|
2020-12-24 04:13:41 +01:00
|
|
|
|
2021-03-29 13:04:53 +02:00
|
|
|
const bakeFile = meta.getBakeFile();
|
2020-12-24 04:13:41 +01:00
|
|
|
expect(JSON.parse(fs.readFileSync(bakeFile, 'utf8'))).toEqual(exBakeDefinition);
|
|
|
|
});
|
|
|
|
});
|
2022-10-07 22:45:46 +02:00
|
|
|
|
|
|
|
describe('sepTags', () => {
|
|
|
|
// prettier-ignore
|
|
|
|
// eslint-disable-next-line jest/expect-expect
|
|
|
|
test.each([
|
|
|
|
[
|
|
|
|
'sepTags01',
|
|
|
|
'event_push_dev.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
sepTags: " "
|
|
|
|
} as Inputs,
|
|
|
|
"user/app:dev user/app:my user/app:custom user/app:tags"
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'sepTags02',
|
|
|
|
'event_push_dev.env',
|
|
|
|
{
|
|
|
|
images: ['user/app'],
|
|
|
|
tags: [
|
|
|
|
`type=ref,event=branch`,
|
|
|
|
`type=raw,my`,
|
|
|
|
`type=raw,custom`,
|
|
|
|
`type=raw,tags`
|
|
|
|
],
|
|
|
|
sepTags: ","
|
|
|
|
} as Inputs,
|
|
|
|
"user/app:dev,user/app:my,user/app:custom,user/app:tags"
|
|
|
|
]
|
|
|
|
])('given %p with %p event', async (name: string, envFile: string, inputs: Inputs, expTags: string) => {
|
2023-04-17 04:42:21 +02:00
|
|
|
|
2022-10-07 22:45:46 +02:00
|
|
|
process.env = dotenv.parse(fs.readFileSync(path.join(__dirname, 'fixtures', envFile)));
|
2023-04-17 04:42:21 +02:00
|
|
|
|
2023-02-20 22:32:55 +01:00
|
|
|
const toolkit = new Toolkit();
|
|
|
|
const repo = await toolkit.github.repoData();
|
2023-04-17 04:42:21 +02:00
|
|
|
const meta = new Meta({...getInputs(), ...inputs}, await getContext(ContextSource.workflow), repo);
|
2022-10-07 22:45:46 +02:00
|
|
|
|
|
|
|
expect(meta.getTags().join(inputs.sepTags)).toEqual(expTags);
|
|
|
|
});
|
|
|
|
});
|