token

package
v0.110.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

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:

  1. 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:

  1. "UPDATECLI_GITHUB_TOKEN"
  2. GitHub App environment variables (GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID, GITHUB_APP_PRIVATE_KEY)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL