GitHub effectively contributes a significant amount of money and work hours by hosting close to all the open source software for free, including some CI time and the collaboration features. For some projects like Nix that's a really non-trivial system on its own. It's not just the code that counts towards FOSS contributions.
But seriously, it would be nice to distribute it. We already have other options coming slowly. The fediverse forges are being worked on and should be available in 2025, like https://forgejo.org/