That sounds nice and all but it's wrong in two major ways.
First: GitHub has a Terms of Service which was somewhat-recently amended to make this license grant explicit:
https://help.github.com/en/articles/github-terms-of-service#...
"Any User-Generated Content you post publicly, including issues, comments, and contributions to other Users' repositories, may be viewed by others. By setting your repositories to be viewed publicly, you agree to allow others to view and 'fork' your repositories (this means that others may make their own copies of Content from your repositories in repositories they control)."
(Crucially, it doesn't require an open-source license, though.)
Second: even without that, there's such a thing as an implied license:
https://en.wikipedia.org/wiki/Implied_license
Like, if you write something down on a piece of paper, you can't then sue the owner of the paper for copyright infringement.
Similarly, if you upload code to GitHub, and tell it to share your code, you can't then sue them for sharing your code, ToS or no ToS.