Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gh_username

Find the current user's GitHub username


Description

Uses the GITHUB_USERNAME global variable or searches on GitHub, for the user's email address, see email_address.

Usage

gh_username(token = NULL, fallback = NULL)

Arguments

token

GitHub token to use. By default it uses the GITHUB_TOKEN environment variable, if set. If unset, uses the GITHUB_PAT environment variable, if set.

fallback

If not NULL then this value is returned if the GitHub username cannot be found, instead of triggering an error.

Details

This function caches the username in the current R session, and if the email address of the user is unchanged, it does not perform another GitHub query.

Value

GitHub username, or an error is thrown if it cannot be found.

See Also

Other user names: email_address, fullname, username, whoami

Examples

## Not run: 
gh_username()

## End(Not run)

whoami

Username, Full Name, Email Address, 'GitHub' Username of the Current User

v1.3.0
MIT + file LICENSE
Authors
Gábor Csárdi [aut, cre], Maëlle Salmon [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.