Github's filetype detection is performed by its linguist module. They have decent documentation for it at that link.
Supposedly this is supposed to be detectable (see implementation), and use the argument right after the 'exec', but I haven't been able to get it to work myself.