{"modulePath":"github.com/nuelScript/skiff","version":"v0.5.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\nPackage github integrates Skiff with a GitHub App: manifest creation, installation tokens, repo listing, authenticated clone URLs, and webhook verification.\n\n## Variables\n\n```go\nvar ErrForbidden = errors.New(\"github app lacks permission\")\n```\nErrForbidden means the app isn't allowed to do this, usually a permission it was never granted.\n\n## Functions\n\n```go\nfunc CloneURL(repo string) string\n```\nCloneURL is the plain https address of a repo given as owner/name.\n\n```go\nfunc IsCloneURLOf(cloneURL, repo string) bool\n```\nIsCloneURLOf reports whether cloneURL is exactly the github.com address of repo, so the installation token is only ever offered to that one repository.\n\n```go\nfunc Manifest(baseURL, name string) string\n```\n\n```go\nfunc ValidRepo(s string) bool\n```\nValidRepo reports whether s is an owner/name pair, not a path.\n\n```go\nfunc VerifySignature(secret string, body []byte, sig string) bool\n```\n\n## Types\n\n```go\ntype Config struct {\n\tID             int64  `json:\"id\"`\n\tSlug           string `json:\"slug\"`\n\tPEM            string `json:\"pem\"`\n\tWebhookSecret  string `json:\"webhook_secret\"`\n\tClientID       string `json:\"client_id\"`\n\tClientSecret   string `json:\"client_secret\"`\n\tInstallationID int64  `json:\"installation_id\"`\n}\n```\nConfig is the persisted GitHub App (identity, private key, secrets, installation); stored 0600 at ~/.skiff/github.json.\n\n```go\nfunc ConvertManifest(code string) (*Config, error)\n```\n\n```go\nfunc Load() *Config\n```\n\n```go\nfunc (c *Config) CloneEnv(cloneURL, repo string) ([]string, error)\n```\nCloneEnv hands git the installation token through its environment, so it isn't written to the clone's .git/config. Empty when cloneURL isn't repo's address.\n\n```go\nfunc (c *Config) Configured() bool\n```\n\n```go\nfunc (c *Config) InstallURL() string\n```\n\n```go\nfunc (c *Config) InstallationToken() (string, error)\n```\nInstallationToken returns a cached installation access token (1h TTL).\n\n```go\nfunc (c *Config) Installed() bool\n```\n\n```go\nfunc (c *Config) ListRepos() ([]Repo, error)\n```\n\n```go\nfunc (c *Config) OpenPullRequest(repo, branch string) (int, error)\n```\nOpenPullRequest finds the open pull request whose head is branch in repo (\"owner/name\"); 0 when there is none.\n\n```go\nfunc (c *Config) Save() error\n```\n\n```go\nfunc (c *Config) SetStatus(repo, sha, state, context, description, targetURL string) error\n```\nSetStatus sets a commit status; state is pending, success, failure or error.\n\n```go\nfunc (c *Config) UpsertComment(repo string, pr int, commentID int64, body string) (int64, error)\n```\nUpsertComment edits the comment if it still exists, otherwise posts a new one, returning the comment's id.\n\n```go\ntype PullRequest struct {\n\tAction string\n\tRepo   string\n\tBranch string\n\tNumber int\n}\n```\n\n```go\nfunc ParsePullRequest(body []byte) (PullRequest, bool)\n```\nParsePullRequest reads a pull\\_request event; pull requests from forks are ignored since their branches live outside the repo.\n\n```go\ntype Push struct {\n\tRepo    string // owner/name\n\tBranch  string\n\tCommit  string\n\tMessage string   // head commit message (first line shown in the UI)\n\tPaths   []string // changed files (best-effort; GitHub truncates very large pushes)\n\tDeleted bool     // the branch was deleted; only Repo and Branch are set\n}\n```\n\n```go\nfunc ParsePush(body []byte) (Push, bool)\n```\n\n```go\ntype Repo struct {\n\tFullName      string `json:\"full_name\"`\n\tName          string `json:\"name\"`\n\tPrivate       bool   `json:\"private\"`\n\tDefaultBranch string `json:\"default_branch\"`\n\tCloneURL      string `json:\"clone_url\"`\n}\n```\n\n","path":"github.com/nuelScript/skiff/internal/github","name":"github","synopsis":"Package github integrates Skiff with a GitHub App: manifest creation, installation tokens, repo listing, authenticated clone URLs, and webhook verification.","isRedistributable":true}
