[github_releases] Refactor script (#226)

Make the script more readable, mostly by:

- using the Product and AutoConfig classes,
- removing the use of functions when unnecessary,
- a little bit of renaming and documentation.
This commit is contained in:
Marc Wrobel
2023-12-10 21:47:49 +01:00
committed by GitHub
parent fe45ca7ece
commit 9e0f4a437a
3 changed files with 37 additions and 55 deletions

View File

@@ -38,7 +38,7 @@ def update_product(product_name, configs):
versions = {}
for config in configs:
t = config.get("template", endoflife.DEFAULT_TAG_TEMPLATE)
t = config.get("template", endoflife.DEFAULT_VERSION_TEMPLATE)
regex = config.get("regex", endoflife.DEFAULT_VERSION_REGEX)
regex = regex.replace("(?<", "(?P<") # convert ruby regex to python regex
versions = versions | fetch_releases(config[METHOD], regex, t)