Earlier quoted context omitted.
Yes, you can "donate" someone else's code, knowing Microsoft will violate a use-with-attribution license. You can do it, but it's WRONG. Copilot is trained on public GitHub repositories of any license: https://en.m.wikipedia.org/wiki/GitHub_Copilot#Technology We must all stop using GitHub.
I wonder what kind of language you would need to add to your license in order to explicitly forbid the ingestion of your code by Copilot and/or like projects.
If Microsoft's theory is correct, under US law it is impossible to forbid this with a license, because a license is just an offer of additional permissions beyond what is available automatically under law, and Microsoft's theory is that ingesting code into GitHub is fair use and therefore permitted under law as an exception to copyright without any license from the copyright owner.
If Microsoft's theory is not correct, pretty much any license with an attribution requirement (among others, for other reasons) would work.
The idea that a special license is needed or of any use doesn't seem to have any justification, even in theory. (As is the idea that hosting publicly but not on GitHub changes the legal parameters.)