{"modulePath":"github.com/cruxstack/github-ops-app","version":"v1.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package setup\n\nPackage setup integrates the github-app-setup-go installer, which creates the GitHub App from a manifest and saves its credentials.\n\n## Constants\n\n```go\nconst (\n\tEnvAppID         = \"APP_GITHUB_APP_ID\"\n\tEnvPrivateKey    = \"APP_GITHUB_APP_PRIVATE_KEY\"\n\tEnvWebhookSecret = \"APP_GITHUB_WEBHOOK_SECRET\"\n)\n```\nThe names the application reads the GitHub App credentials from.\n\n```go\nconst AppName = \"github-ops-app\"\n```\nAppName is the default name of the GitHub App.\n\n## Variables\n\n```go\nvar Events = []string{\"pull_request\", \"team\", \"membership\"}\n```\nEvents are the webhook events the application handles.\n\n```go\nvar Permissions = map[string]string{\n\n\t\"administration\":         \"read\",\n\t\"checks\":                 \"read\",\n\t\"metadata\":               \"read\",\n\t\"pull_requests\":          \"read\",\n\t\"statuses\":               \"read\",\n\t\"vulnerability_alerts\":   \"read\",\n\t\"security_events\":        \"read\",\n\t\"secret_scanning_alerts\": \"read\",\n\n\t\"members\": \"write\",\n}\n```\nPermissions are the GitHub App permissions the application needs, and no more.\n\n## Functions\n\n```go\nfunc Manifest() installer.Manifest\n```\nManifest returns the GitHub App manifest. The app is private, so only the organization that creates it can install it.\n\n## Types\n\n```go\ntype NopStore struct{}\n```\nNopStore is a credential store for when the installer is disabled.\n\n```go\nfunc (NopStore) DisableInstaller(context.Context) error\n```\n\n```go\nfunc (NopStore) Save(context.Context, *configstore.AppCredentials) error\n```\n\n```go\nfunc (NopStore) Status(context.Context) (*configstore.InstallerStatus, error)\n```\n\n```go\ntype Store struct {\n\tconfigstore.Store\n}\n```\nStore 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.\n\n```go\nfunc (s Store) Save(ctx context.Context, creds *configstore.AppCredentials) error\n```\nSave adds the application's names for the credentials and saves them.\n\n","path":"github.com/cruxstack/github-ops-app/internal/setup","name":"setup","synopsis":"Package setup integrates the github-app-setup-go installer, which creates the GitHub App from a manifest and saves its credentials.","isRedistributable":true}
