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

set_github_pat

Set your Github Personal Access Token


Description

Populates the GITHUB_PAT environment variable using the git_credential manager, which git itself uses for storing passwords. The credential manager returns stored credentials if available, and securely prompt the user for credentials when needed.

Usage

set_github_pat(force_new = FALSE, validate = interactive(), verbose = validate)

Arguments

force_new

forget existing pat, always ask for new one.

validate

checks with the github API that this token works. Defaults to TRUE only in an interactive R session (not when running e.g. CMD check).

verbose

prints a message showing the credential helper and PAT owner.

Details

Packages that require a GITHUB_PAT can call this function to automatically set the GITHUB_PAT when needed. Users may call this function in their .Rprofile script to automatically set GITHUB_PAT for each R session without hardcoding any tokens on disk in plain-text.

Value

Returns TRUE if a valid GITHUB_PAT was set, and FALSE if not.


credentials

Tools for Managing SSH and Git Credentials

v1.3.0
MIT + file LICENSE
Authors
Jeroen Ooms [aut, cre] (<https://orcid.org/0000-0002-4035-0289>)
Initial release

We don't support your browser anymore

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