I remember coming across HoMM around 2008, but the published game was nowhere available near where I lived, so I ended up playing a web based clone[0].
Been playing it for around 17 years, and it is still quite fun.
I recently came across TypescriptToLua[0] which has improved my experience of writing Lua manyfolds. No more having to deal with 1-based indexes or lack of type hints.
Coincidentally, I've been mulling the same idea for a week now. A self-hostable source forge + registry to serve artifacts would be amazing.
I think the only thing you'd lose is the 'social' aspects of GitHub, but I believe that can be made up with a combination of rss feeds (?), ActivityPub etc.
I think we've been thinking similarly. Decentralization will have it's costs. I've been thinking Opt-In centralized search for personal repos, maybe as a gitea (or other self hosted options) plug-in. But as you suggest, maybe existing features can be leveraged to prove the social/discoverability.