GitHub uses the email address in the commit header to link the commit to a GitHub user.
What does this mean? That the data on the commit doesn't actually have to be equivalent to a GitHub user, since I could have set my commit headers with a different e-mail that the one that I use in GitHub.
On the other hand, if the user who did the commit has a public email address set in GitHub, it's easy to retrieve its user info through the User Search API.
For example, since I have a public email in GitHub if you look for https://api.github.com/search/users?q=dacamposol@gmail.com you'll receive the following response:
{
total_count: 1,
incomplete_results: false,
items: [
{
login: "dacamposol",
id: 16921751,
node_id: "MDQ6VXNlcjE2OTIxNzUx",
avatar_url: "https://avatars.githubusercontent.com/u/16921751?v=4",
gravatar_id: "",
url: "https://api.github.com/users/dacamposol",
html_url: "https://github.com/dacamposol",
followers_url: "https://api.github.com/users/dacamposol/followers",
following_url:
"https://api.github.com/users/dacamposol/following{/other_user}",
gists_url: "https://api.github.com/users/dacamposol/gists{/gist_id}",
starred_url: "https://api.github.com/users/dacamposol/starred{/owner}{/repo}",
subscriptions_url: "https://api.github.com/users/dacamposol/subscriptions",
organizations_url: "https://api.github.com/users/dacamposol/orgs",
repos_url: "https://api.github.com/users/dacamposol/repos",
events_url: "https://api.github.com/users/dacamposol/events{/privacy}",
received_events_url: "https://api.github.com/users/dacamposol/received_events",
type: "User",
site_admin: false,
score: 1
}
]
}
If the person doesn't have a public email address, maybe you should just refer to the user provided in the user.name header in the commit, since maybe that person values its privacy and that's why it didn't set his email as public in GitHub.