Documentation ¶
Index ¶
Constants ¶
View Source
const ( // CommitStatusPendingDescription is the description used for PR commit status for pipelines we have just kicked off. CommitStatusPendingDescription = "Pipeline pending" // OverriddenByPrefix is the beginning of the description for commit statuses set by /override OverriddenByPrefix = "Overridden by" // GitHubAppGitRemoteUsername Username for git https URLs when using a GitHub App token. // see https://developer.github.com/apps/building-github-apps/authenticating-with-github-apps/#http-based-git-access-by-an-installation GitHubAppGitRemoteUsername = "x-access-token" // GitHubAppSecretDirEnvVar is the name of the environment variable which would contain secrets when this is configured // with the GitHub App. GitHubAppSecretDirEnvVar = "GITHUB_APP_SECRET_DIR" // #nosec // GitHubAppAPIUserFilename is the filename inside the GitHub App secrets dir which will contain the user we will // use for GitHub API calls when present. GitHubAppAPIUserFilename = "username" )
Variables ¶
This section is empty.
Functions ¶
func AddAuthToSCMClient ¶ added in v0.0.492
AddAuthToSCMClient configures an existing go-scm client with transport and authorization using the given token, depending on whether the token is a GitHub App token
func FileExists ¶ added in v0.0.492
FileExists checks if path exists and is a file
func GetGitHubAppAPIUser ¶ added in v0.0.492
GetGitHubAppAPIUser returns the username to be used for GitHub API calls with the GitHub App, if so configured. If there is no configured secrets dir, it returns an empty string.
func GetGitHubAppSecretDir ¶ added in v0.0.492
func GetGitHubAppSecretDir() string
GetGitHubAppSecretDir returns the location of the GitHub App secrets dir, if defined, and an empty string otherwise
Types ¶
type OwnerTokensDir ¶ added in v0.0.492
type OwnerTokensDir struct {
// contains filtered or unexported fields
}
OwnerTokensDir handles finding owner based tokens in a directory for GitHub Apps
func NewOwnerTokensDir ¶ added in v0.0.492
func NewOwnerTokensDir(gitServer, dir string) *OwnerTokensDir
NewOwnerTokensDir creates a new dir token scanner
Click to show internal directories.
Click to hide internal directories.