I recently changed my GitHub username, and now a lot of my repositories still contain my old username inside files like README.md, package.json, and even code comments.
GitHub automatically redirects repo URLs, but the old username still appears in badges, links, and npm references.
Updating them manually across multiple repos would take hours.
Is there a way to automatically replace the old username with the new one across all my repositories — preferably using the GitHub API or some automation script?
I’m looking for something that can:
Scan all my repos
Detect my old username in files (like Markdown or JSON)
Replace it with the new one
Commit and push the changes automatically
Any existing tools or scripts that can handle this safely?