Documentation
¶
Overview ¶
Package token resolves a GitHub Personal Access Token from multiple sources.
Priority order:
- Explicit flag value (--token / --github-token)
- .devlake.env file (GITHUB_PAT=...)
- Environment variables ($GITHUB_TOKEN / $GH_TOKEN)
- Interactive masked prompt (terminal)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ResolveResult ¶
type ResolveResult struct {
Token string
Source string // "flag", "envfile", "environment", "prompt"
EnvFilePath string // non-empty if loaded from envfile (for cleanup)
}
ResolveResult contains the resolved token and its source.
func Resolve ¶
func Resolve(flagValue, envFilePath string) (*ResolveResult, error)
Resolve attempts to find a PAT using the priority chain. Returns an error only if no token can be obtained.