The Red Hat people changed the format of the dates AND the format of the versions from this:
=== RHSA-2024:5808 - {product-title} 4.12.64 bug fix and security update
to this
=== RHSA-2024:0041 - {product-title} {product-version}.0 image release, bug fix, and security update advisory.
But not for all branches, but only for the latest (4.16 and up).
Fixes#378
This way the writing of the JSON file is handled automatically if the update does not fail.
It pave the way to further global improvements, such as a better error handling.
It may not be the best place for that (gha.py would have been better), but it's the shorter / faster way to do it for now.
Moreover it now uses logging for writing the group. The logger format has been updated for this to work. This was done to fix issues on GitHub Action logs, where groups were declared after the logs.
Make the script more readable, mostly by:
- using the Product class,
- a little bit of renaming and documentation,
- removing the use of functions when unnecessary.
The script only get versions 4.x and above, see script comments for more informations.
Note that the code related to git has been extracted to a common script so that it can be reused for the Debian script.