0
0
mirror of https://github.com/thegeeklab/wp-docker-buildx.git synced 2024-11-28 18:20:35 +00:00

fix: ignore version metadata with auto_tag (#60)

This commit is contained in:
Robert Kaussow 2023-11-04 22:55:05 +01:00 committed by GitHub
parent b4265d3d97
commit a75fea4995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -55,7 +55,7 @@ func DefaultTags(ref string) ([]string, error) {
return []string{"latest"}, err return []string{"latest"}, err
} }
if version.PreRelease != "" || version.Metadata != "" { if version.PreRelease != "" {
return []string{ return []string{
version.String(), version.String(),
}, nil }, nil

View File

@ -32,8 +32,10 @@ func TestDefaultTags(t *testing.T) {
{"refs/heads/main", []string{"latest"}}, {"refs/heads/main", []string{"latest"}},
{"refs/tags/0.9.0", []string{"0.9", "0.9.0"}}, {"refs/tags/0.9.0", []string{"0.9", "0.9.0"}},
{"refs/tags/1.0.0", []string{"1", "1.0", "1.0.0"}}, {"refs/tags/1.0.0", []string{"1", "1.0", "1.0.0"}},
{"refs/tags/v1.0.0+meta", []string{"1", "1.0", "1.0.0"}},
{"refs/tags/v1.0.0", []string{"1", "1.0", "1.0.0"}}, {"refs/tags/v1.0.0", []string{"1", "1.0", "1.0.0"}},
{"refs/tags/v1.0.0-alpha.1", []string{"1.0.0-alpha.1"}}, {"refs/tags/v1.0.0-alpha.1", []string{"1.0.0-alpha.1"}},
{"refs/tags/v1.0.0-alpha", []string{"1.0.0-alpha"}},
} }
for _, test := range tests { for _, test := range tests {