Skip to content

Commit

Permalink
docs: explain accounts and events fields in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Dec 22, 2023
1 parent c585e56 commit 9163607
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ await getGitHubUsernameEmails({ username: "joshuakgoldberg" });

Calling `getGitHubUsernameEmails` will try to find the user's email from two public data points:

- [`/users/${username}`](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-a-user): public account information
- [`/users/{username}/events`](https://docs.github.com/en/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-user):
- `account`: [`/users/${username}`](https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-a-user): public account information
- `events`: [`/users/{username}/events`](https://docs.github.com/en/rest/activity/events?apiVersion=2022-11-28#list-public-events-for-a-user): commits pushed by the user
- This is stored as an object containing, under each email, the commit names associated with that email
- Note that these may be commits originally authored by other users, _not_ the user you're looking for

Note that `account` might be `undefined` and `events` might be `{}`.
Only publicly visible emails can be retrieved.
Expand Down

0 comments on commit 9163607

Please sign in to comment.