Remove duplicated tags

This commit is contained in:
CrazyMax 2020-11-18 01:10:05 +01:00
parent 8adbcfe00d
commit a017e545d7
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
3 changed files with 30 additions and 0 deletions

View File

@ -683,6 +683,34 @@ describe('push tag', () => {
"org.opencontainers.image.licenses=MIT" "org.opencontainers.image.licenses=MIT"
] ]
], ],
[
'event_tag_v1.1.1.env',
{
images: ['org/app', 'ghcr.io/user/app'],
tagSemver: ['{{version}}', '{{major}}.{{minor}}.{{patch}}'],
} 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.title=Hello-World",
"org.opencontainers.image.description=This your first repo!",
"org.opencontainers.image.url=https://github.com/octocat/Hello-World",
"org.opencontainers.image.source=https://github.com/octocat/Hello-World",
"org.opencontainers.image.version=1.1.1",
"org.opencontainers.image.created=2020-01-10T00:30:00.000Z",
"org.opencontainers.image.revision=90dd6032fac8bda1b6c4436a2e65de27961ed071",
"org.opencontainers.image.licenses=MIT"
]
],
[ [
'event_tag_v2.0.8-beta.67.env', 'event_tag_v2.0.8-beta.67.env',
{ {

1
dist/index.js generated vendored
View File

@ -240,6 +240,7 @@ class Meta {
else if (/^refs\/pull\//.test(this.context.ref)) { else if (/^refs\/pull\//.test(this.context.ref)) {
version.main = `pr-${this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, '')}`; version.main = `pr-${this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, '')}`;
} }
version.partial = version.partial.filter((item, index) => version.partial.indexOf(item) === index);
return version; return version;
} }
tags() { tags() {

View File

@ -82,6 +82,7 @@ export class Meta {
version.main = `pr-${this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, '')}`; version.main = `pr-${this.context.ref.replace(/^refs\/pull\//g, '').replace(/\/merge$/g, '')}`;
} }
version.partial = version.partial.filter((item, index) => version.partial.indexOf(item) === index);
return version; return version;
} }