But that doesn’t happen – if a repo violates US law, they remove it completely, even if it would have been completely fine under German law, for example.
If GitHub is hosted in the US, and a repo that is hosted by GitHub violates US law, they probably cannot continue to host that repo in the US and serve it only to non-US clients.