github_with_pat: 'withr'-like functions for temporary personal access token

github_with_patR Documentation

withr-like functions for temporary personal access token

Description

Temporarily change the GITHUB_PAT environmental variable for GitHub authentication. Based on the withr interface.

Usage

with_pat(new, code)

local_pat(new, .local_envir = parent.frame())

Arguments

new

Temporary GitHub access token

code

Code to execute with the temporary token

.local_envir

The environment to use for scoping.

Details

if new = NA is used the GITHUB_PAT environment variable will be unset.

Value

The results of the evaluation of the code argument.

Examples

## Not run: 
with_pat("1234", print(github_get_token()))

## End(Not run)


ghclass documentation built on May 29, 2024, 8:44 a.m.