Is the GitHub username displayed based on the email address set in the git client?

I’ve somehow managed to commit to a repo and it’s showing it as a different user to the one I’m expecting. Even more confusing is that other account doesn’t have access to that repo.

It’s a different user and SSH key used to upload, but my git.email will match the first account.

@Dragon yes I believe it's all just based on the email address in each commit (which is set by the git client).
That's why signed commits are considered important as otherwise impersonation is trivial.