Skip to main content

resolve_github_token_with_env

Function resolve_github_token_with_env 

Source
pub fn resolve_github_token_with_env(
    explicit: Option<&str>,
    env: &dyn Fn(&str) -> Option<String>,
) -> Option<String>
Expand description

Resolve the GitHub token for API calls through the codebase-standard chain: explicit value (CLI flag / context option) → ANODIZER_GITHUB_TOKENGITHUB_TOKEN. Empty strings count as absent at every link — GitHub Actions materializes missing secrets as "", which must not short-circuit the fallback to the next link.

env is the injectable env source (pass Context::env_var or a map-backed closure in tests) so the chain is testable without mutating process env.