“This is primarily to ensure we can support the load for developers on GitHub and help protect the servers from being overwhelmed by anonymous requests from bots etc.”
A maintainer tried to search his own public repository from an old machine and hit a login wall, then a 2FA wall. GitHub’s answer blames bots and load. The official reply drew 17 thumbs up and 200 thumbs down. The code is public. Searching it now requires an account.