Skip to content

sort filter should sort sem-ver-wise by default #192

@salim-b

Description

@salim-b

I've noticed this is kinda already mentioned as a known issue in the README.

A real-world example where I cannot get the latest version of the Docker image with the existing filters without hardcoding the major version number:

> bump pipeline 'docker:miniflux/miniflux'
1.2.4

> bump pipeline 'docker:miniflux/miniflux|sort|/^\d/'
2.2.9-distroless

# we need to hardcode the major version in the filter to actually get the latest version
> bump pipeline 'docker:miniflux/miniflux|^2'
2.2.15

> bump pipeline 'docker:miniflux/miniflux|^2|/-distroless$/'
2.2.15-distroless

Any chance we could have a sort_semver filter or the like that compares each version number component individually, so it would be fully compatible with semantic versioning?

Masterminds/semver you're importing mentions this. Otherwise there would be the Sort() function from golang.org/x/mod/semver...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions