Documentation ¶
Overview ¶
Package github contains routines for interacting with GitHub.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GithubAppConfig ¶
type GithubAppConfig struct { // ID of the Github App to authenticate as. AppID int64 `json:"app_id"` // ID of the Github App installation to authenticate as. This ID determines the Github Org that the App can access. AppInstallationID int64 `json:"app_installation_id"` // The PEM encoded private key (base64 encoded) that can be used to obtain an installation token to access the // Github API. PrivateKeyPEMBase64 string `json:"private_key_pem"` }
GithubAppConfig represents configuration settings for a Github App that can be used to authenticate to the Github API.
func LoadGithubAppConfigFromEnv ¶
func LoadGithubAppConfigFromEnv(envVarName string) (*GithubAppConfig, error)
LoadGithubAppConfigFromEnv will load a Github App Configuration from the given environment variable, assuming it is encoded in JSON format.
func (*GithubAppConfig) GetInstallationToken ¶
func (config *GithubAppConfig) GetInstallationToken() (string, error)
GetInstallationToken uses the configured GitHub App credentials to obtain an installation token that can be used to access Github using both the API and Git CLI. This token works the same as an Oauth token, or Personal Access Token.
Click to show internal directories.
Click to hide internal directories.