Well, I'm currently working on GitHub encryption plugin, that will encrypt your code on the repository from prying eyes (somebody tell me if I'm being paranoid please 🙈)
Any one who needs to download the source code will need the plugin agent installed on the machine, that will prove that user is human, then the user will obtain token for decryption of downloaded repository.
Keybase had encrypted repos for private use back then. If you don’t trust Microsoft—and you shouldn’t—then stop using their products like GitHub instead of trying to build hacks atop a proprietary platform since you can’t directly modify the code.
Assuming you're using Github to publish your own free and open-source software, remember that this is one of the basic tenets of FOSS:
The freedom to run the program as you wish, for any purpose
Even purposes you don't like or agree with.
If you're worried about megacorps stealing your code without giving you credit, just licence your code under the GPL or AGPL. They won't touch it with a 10-foot pole.