lilydjwg / nvchecker

New version checker for software releases
MIT License
431 stars 69 forks source link

Possibility to strip release/tags with regex ? #187

Closed rasjani closed 3 years ago

rasjani commented 3 years ago

Case example: openssl .. It has tags / releases that append "-alpha*" postfix. Since i dont need/want to include alpha or release candidate versions, it would be nice that at least the provided github checker could have some way of providing a regular expression of versions to completely ignore.

I would have thought that exclude_regex would provide this but i have following in the config toml

  [openssl]
  source = "github"
  github = "openssl/openssl"
  use_latest_tag = true
  prefix = "openssl-"
  exclude_regex = ".*alpha.*"

and running nvchecker -c nvchecker_config.toml -e openssl results:

[I 06-02 14:16:31.411 core:349] openssl: updated from 1.1.1i to 3.0.0-alpha17
lilydjwg commented 3 years ago

use_latest_tag will return a single result so that exclude_regex and the like won't work. There is an option query along with the API but it's meaning is unclear.

yan12125 commented 3 years ago

query seems to be something like a keyword. It does not seem to support regular expressions, though. Anyway, use_max_tag works in this case.

$ cat t.toml
[openssl]
source = "github"
github = "openssl/openssl"
use_max_tag = true
prefix = "OpenSSL_"
include_regex = "OpenSSL_\\d_\\d_\\d[a-z]?"
$ nvchecker -c t.toml
[I 06-03 11:06:57.209 core:349] openssl: updated to 1_1_1k

I use include_regex instead of exclude_regex to get rid of strange tags like STATE_before_zlib.