The GitHub terms of service has always granted GitHub additional rights. If you put up code with a license incompatible with those rights, then you are the responsible party for the violation, again as per GitHub's terms of service.
This was true before AI, and the ToS now explicitly includes AI training to avoid confusion.
In short: it has never been a good idea to put anything with a copy left or strong license up on GitHub if you wanted them to abide by it.