You said it yourself: GitHub users can use GitHub projects on GitHub. Git submodules stay on GitHub, so it's allowed.
> you grant each User of GitHub a nonexclusive, worldwide license to use, display, and perform Your Content through the GitHub Service and to reproduce Your Content solely on GitHub as permitted through GitHub's functionality (for example, through forking)
You can run the code on GitHub Codespaces & GitHub Actions, you can fork the code to make changes, and you can dynamically link/embed the code in other projects on GitHub through git submodules.
You have the right to use this project via git submodules. The GitHub terms of service requires code owners to allow forking and linking to their public repositories, regardless of license.
With GitHub Codespaces and GitHub Actions you aren't compiling or running the code, GitHub is.
From my understanding, this satisfies the following:
> solely on GitHub as permitted through GitHub's functionality