For some reason I needed to contact the Github repository author, so I researched it.

The first way

Go to the repository that the Github user created and find his commit.

Such as:

The second way

Use Github’s GraphQL to query users’ mailboxes

Go to Github’s GraphQL API Explorer, click Sign in on the right, log in with your Github account, and then call Github’s API.

Once logged in, the GraphQL input box below you is ready to enter content. Enter the following code:

{
  repository(name: "grank", owner: "lctt") {
    ref(qualifiedName: "master") {
      target {
        ... on Commit {
          id
          history(first: 5) {
            edges {
              node {
                author {
                  name
                  email
                }
              }
            }
          }
        }
      }
    }
  }
}
Copy the code

Replace name with the repO name of the person you want to query, owner with the name of the person you want to query, and click the Execute button.

To the right, your execution results will appear, and you will see the “email” address we want.

You will find there are two types of email. The first type is common to us, such as QQ email, netease email and Google email. The other is a 27856297+ dependabot-Preview [bot]@users.noreply.github.com.

The difference between these two types of email is that the former is the one we fill in when we register for Github; The latter is the default mailbox generated by Github. When we generate commit records through Github web pages and API operations, the default mailbox generated by Github is used for email information.

You can also make your email invisible in the Settings, so that no one can know your email

conclusion

  • The domestic code cloud can also obtain the mailbox through the first method.

  • If the user doesn’t have any submission records then there’s no way to know their email address.