Rather than compile a new version for each release:
Search for porteus-v*.cfg rather than porteus-v5.1-x86_64.cfg, etc.
Have the porteus-*.cfg name be a fixed porteus.initrd.cfg name or porteus-x86_64.cfg name or something similar.
If the porteus .cfg file's name must be unique have the release number of it be a cheatcode used when testing.
Interesting links:
Editing initrd (Post by ralcocer #36554)
how open & close initrd.xz