If an attacker wanted to hand me bad code, couldn’t they also hand me a bad signature/certificate/key?
This is what multi-party key signing is for. Now, multiple people verify code, and also verify build artifacts. Rather than trusting an individual, you trust a process during which developer's continuously verify each other.
The other thing to note is that the builder is not always the distributor. For example many Linux distro's have mirrors setup, where they share their built artifacts to other institutions and hosters, who then redistribute code.
Even for a single party, key signing has value because it ensures that everything after the original creation of the artifacts is not compromised, as long as the key distribution system is different than the distribution system of the artifacts.
But for a solo dev on Github, yes. Signing doesn't really do anything, since the developer and the distribution chain are close enough that it's highly likely the key would be compromised along with the source.