Documentation
¶
Index ¶
- func GetAccessToken(tokenSource oauth2.TokenSource) (string, error)
- func GetFallbackTokenSourceFromEnv() (string, oauth2.TokenSource)
- func GetTokenSourceFromConfig(username, token string, app *app.Spec) (string, oauth2.TokenSource, error)
- func GetTokenSourceFromEnv() (string, oauth2.TokenSource, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAccessToken ¶
func GetAccessToken(tokenSource oauth2.TokenSource) (string, error)
GetAccessToken retrieves a valid access token from a TokenSource
func GetFallbackTokenSourceFromEnv ¶
func GetFallbackTokenSourceFromEnv() (string, oauth2.TokenSource)
GetFallbackTokenSourceFromEnv retrieves a valid access token from the "GITHUB_TOKEN" environment variable This function is used as a fallback mechanism if no other token source could be found It is primarily intended to support GitHub Actions workflows
func GetTokenSourceFromConfig ¶
func GetTokenSourceFromConfig(username, token string, app *app.Spec) (string, oauth2.TokenSource, error)
GetTokenSourceFromConfig retrieves a valid access token from a Spec configuration It supports both personal access tokens and GitHub App tokens The precedence is as follows:
- Token provided in the Spec configuration
2. GitHub App configuration in the Spec 3. No token found, return an empty value
func GetTokenSourceFromEnv ¶
func GetTokenSourceFromEnv() (string, oauth2.TokenSource, error)
GetTokenSourceFromEnv retrieves a valid access token from environment variables It supports both personal access tokens and GitHub App tokens The precedence is as follows:
- "UPDATECLI_GITHUB_TOKEN"
- GitHub App environment variables (GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID, GITHUB_APP_PRIVATE_KEY)
Types ¶
This section is empty.