Documentation
¶
Overview ¶
Package setup integrates the github-app-setup-go installer, which creates the GitHub App from a manifest and saves its credentials.
Index ¶
Constants ¶
const ( EnvAppID = "APP_GITHUB_APP_ID" EnvPrivateKey = "APP_GITHUB_APP_PRIVATE_KEY" EnvWebhookSecret = "APP_GITHUB_WEBHOOK_SECRET" )
The names the application reads the GitHub App credentials from.
const AppName = "github-ops-app"
AppName is the default name of the GitHub App.
Variables ¶
var Events = []string{"pull_request", "team", "membership"}
Events are the webhook events the application handles.
var Permissions = map[string]string{
"administration": "read",
"checks": "read",
"metadata": "read",
"pull_requests": "read",
"statuses": "read",
"vulnerability_alerts": "read",
"security_events": "read",
"secret_scanning_alerts": "read",
"members": "write",
}
Permissions are the GitHub App permissions the application needs, and no more.
Functions ¶
Types ¶
type NopStore ¶
type NopStore struct{}
NopStore is a credential store for when the installer is disabled.
func (NopStore) Save ¶
func (NopStore) Save(context.Context, *configstore.AppCredentials) error
func (NopStore) Status ¶
func (NopStore) Status(context.Context) (*configstore.InstallerStatus, error)
type Store ¶
type Store struct {
configstore.Store
}
Store wraps a credential store so the credentials are also saved under the names the application reads. The store's own names, such as GITHUB_APP_ID, are still written, since its status checks read them.
func (Store) Save ¶
func (s Store) Save(ctx context.Context, creds *configstore.AppCredentials) error
Save adds the application's names for the credentials and saves them.