diff --git a/.tools/internal/config/packages/packages.go b/.tools/internal/config/packages/packages.go index c07eecb..8a1efc1 100644 --- a/.tools/internal/config/packages/packages.go +++ b/.tools/internal/config/packages/packages.go @@ -141,6 +141,10 @@ type GitOptions struct { // when a tag is used and the version is able to be parsed as a // semver. Defaults to false. ConsiderPreReleases bool `yaml:"consider_pre_releases"` + + // IgnoreVersions is a list of versions to always ignore (looking at + // you, Zed). + IgnoreVersions []string `yaml:"ignore_versions"` } // APTOptions contains the options for the APT resolver. diff --git a/.tools/internal/resolver/git.go b/.tools/internal/resolver/git.go index 70f50c0..bb71802 100644 --- a/.tools/internal/resolver/git.go +++ b/.tools/internal/resolver/git.go @@ -21,6 +21,7 @@ import ( "fmt" "os" "os/exec" + "slices" "strings" "github.com/blang/semver/v4" @@ -69,6 +70,11 @@ func getGitVersion(ce *packages.Package) (string, error) { // Strip the "refs/tags/" prefix. tag := strings.TrimPrefix(fqTag, "refs/tags/") + // Ignore the version if told to do so. + if slices.Contains(ce.GitOptions.IgnoreVersions, tag) { + continue + } + // Attempt to parse as a semver, for other options. if sv, err := semver.ParseTolerant(tag); err == nil { isPreRelease := len(sv.Pre) > 0