check_github_pat: Check GITHUB_PAT setting

View source: R/diagnostic_test.R

check_github_patR Documentation

Check GITHUB_PAT setting

Description

If the GITHUB_PAT system variable is set, it can cause issues with R installing packages from GitHub (usually with an error of "ERROR [curl: (22) The requested URL returned error: 401]"). This function checks whether the variable is set and (with clean = TRUE) clears it for the current R session.

The function masks the PAT value both in console output and in the returned list (only its length and last four characters are shown). The raw value is never returned, so it is safe to share the result of diagnostic_test().

Usage

check_github_pat(clean = FALSE)

Arguments

clean

If TRUE, attempt to clean detected issues. Default FALSE.

Details

Each check returns a list including a status field, one of "pass", "fail", "fixed" or "info", depending on the outcome of the check.

Value

List object containing GITHUB_PAT (masked: empty string when unset, otherwise "..." followed by the last four characters) plus a status field.

Examples

check_github_pat()

dfeR documentation built on Sept. 24, 2026, 1:07 a.m.