Documentation
¶
Overview ¶
Package github integrates Skiff with a GitHub App: manifest creation, installation tokens, repo listing, authenticated clone URLs, and webhook verification.
Index ¶
- Variables
- func Manifest(baseURL, name string) string
- func VerifySignature(secret string, body []byte, sig string) bool
- type Config
- func (c *Config) CloneURLWithToken(cloneURL string) (string, error)
- func (c *Config) Configured() bool
- func (c *Config) InstallURL() string
- func (c *Config) InstallationToken() (string, error)
- func (c *Config) Installed() bool
- func (c *Config) ListRepos() ([]Repo, error)
- func (c *Config) OpenPullRequest(repo, branch string) (int, error)
- func (c *Config) Save() error
- func (c *Config) UpsertComment(repo string, pr int, commentID int64, body string) (int64, error)
- type Push
- type Repo
Constants ¶
This section is empty.
Variables ¶
var ErrForbidden = errors.New("github app lacks permission")
ErrForbidden means the app isn't allowed to do this, usually a permission it was never granted.
Functions ¶
Types ¶
type Config ¶
type Config struct {
ID int64 `json:"id"`
Slug string `json:"slug"`
PEM string `json:"pem"`
WebhookSecret string `json:"webhook_secret"`
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
InstallationID int64 `json:"installation_id"`
}
Config is the persisted GitHub App (identity, private key, secrets, installation); stored 0600 at ~/.skiff/github.json.
func ConvertManifest ¶
func (*Config) CloneURLWithToken ¶
func (*Config) Configured ¶
func (*Config) InstallURL ¶
func (*Config) InstallationToken ¶
InstallationToken returns a cached installation access token (1h TTL).
func (*Config) OpenPullRequest ¶ added in v0.2.0
OpenPullRequest finds the open pull request whose head is branch in repo ("owner/name"); 0 when there is none.