GitHub is also from them and brings the very same risks. The solution would be to build viable open source alternative but decentralized. GitLab Federation [1] or Forgejo (Codeberg) Federation [2] might be the answer.
[1] https://gitlab.com/gitlab-org/gitlab/-/issues/6468
[2] https://codeberg.org/forgejo-contrib/federation/src/branch/m...