Skip to main content

resolve_github_token

Function resolve_github_token 

Source
pub fn resolve_github_token() -> Result<String, SecretsError>
Expand description

Resolve a GitHub token from environment or gh auth token.

Resolution order:

  1. GITHUB_TOKEN environment variable
  2. GH_TOKEN environment variable
  3. gh auth token command output

ยงErrors

Returns SecretsError::NotFound if no token could be found. Returns SecretsError::CommandFailed if gh exists but returns an error. Returns SecretsError::Io if gh cannot be executed.