Versions in this module Expand all Collapse all v0 v0.2.4 Oct 21, 2026 v0.2.3 Oct 10, 2026 v0.2.2 Oct 10, 2026 v0.2.1 Oct 10, 2026 v0.2.0 Oct 10, 2026 Changes in this version + const EventApprove + const EventRequestChanges + var ErrHeadMoved = errors.New("branch head moved") + var ErrInvalidCommitOID = errors.New("commit SHA must be 40 or 64 hex characters (full OID required)") + var ErrInvalidDecisionEvent = errors.New("decision event must be APPROVE or REQUEST_CHANGES") + var ErrInvalidRepoID = errors.New("invalid or empty repository ID") + var ErrMissingOwnerOrRepo = errors.New("owner and repo must not be empty") + var ErrPushAuthUnavailable = errors.New(...) + var ErrRetrievalAuthUnavailable = errors.New(...) + var ErrScopeTooBroad = errors.New("retrieval credential scope too broad or unverified") + var ErrServiceActorMalformed = errors.New("service actor response malformed") + var ErrServiceActorPermission = errors.New("service actor permission error") + var ErrServiceActorUnavailable = errors.New("service actor unavailable") + func ClassifyWriteError(err error) retry.Classification + func IsUncertainWriteError(err error) bool + func ParsePRURL(prURL string) (owner string, repo string, number int, err error) + func ParseRepoOwner(repoFlag string) []string + func SanitizeCommitHeadline(englishSummary, originalInstruction, shortSHA string) string + func ValidateCommitOID(sha string) error + type AppAuth struct + func (a *AppAuth) CreatePushCredential(ctx context.Context, owner, repo string, repoID int64) (*PushCredential, error) + func (a *AppAuth) CreateRetrievalCredential(ctx context.Context, owner, repo string, repoID int64) (*RetrievalCredential, error) + func (a *AppAuth) GetServiceActor(ctx context.Context) (*ServiceActor, error) + func (a *AppAuth) RevokePushCredential(ctx context.Context, cred *PushCredential) error + func (a *AppAuth) RevokeRetrievalCredential(ctx context.Context, cred *RetrievalCredential) error + type Client struct + func NewAppClient(appID int64, privateKeyPath string) (*Client, error) + func NewAppClientFromKey(appID int64, keyData []byte) (*Client, error) + func NewClient(token string) *Client + func NewClientFromConfig(cfg *config.Config) *Client + func NewTestAppClient(baseURL string, appID int64, privateKey *rsa.PrivateKey) (*Client, error) + func NewTestClient(baseURL string) (*Client, error) + func NewTestClientWithToken(baseURL, token string) (*Client, error) + func (c *Client) AddLabels(ctx context.Context, owner, repo string, number int, labels []string) error + func (c *Client) AppAuth() *AppAuth + func (c *Client) CanWriteRepository(ctx context.Context, owner, repo, username string) (bool, error) + func (c *Client) CommitFileAtExpectedHead(ctx context.Context, ...) (string, error) + func (c *Client) CommitFilesAtExpectedHead(ctx context.Context, ...) (string, error) + func (c *Client) CreateComment(ctx context.Context, owner, repo string, number int, body string) (int64, error) + func (c *Client) CreatePushCredential(ctx context.Context, owner, repo string, repoID int64) (*PushCredential, error) + func (c *Client) CreateRetrievalCredential(ctx context.Context, owner, repo string, repoID int64) (*RetrievalCredential, error) + func (c *Client) EditComment(ctx context.Context, owner, repo string, commentID int64, body string) error + func (c *Client) FindOwnedComment(ctx context.Context, opts FindOwnedCommentOptions) (*OwnedCommentMatch, error) + func (c *Client) GetBlob(ctx context.Context, owner, repo, sha string) (*github.Blob, error) + func (c *Client) GetBlobRaw(ctx context.Context, owner, repo, sha string) ([]byte, error) + func (c *Client) GetComment(ctx context.Context, owner, repo string, commentID int64) (*github.IssueComment, error) + func (c *Client) GetComments(ctx context.Context, owner, repo string, number int) ([]Comment, []DiscussionThread, error) + func (c *Client) GetCommit(ctx context.Context, owner, repo, sha string) (*github.RepositoryCommit, error) + func (c *Client) GetDiffAtCommits(ctx context.Context, owner, repo, baseOID, headOID string) (string, error) + func (c *Client) GetFileContent(ctx context.Context, owner, repo, path, ref string) (*FileContent, error) + func (c *Client) GetLabels(ctx context.Context, owner, repo string, number int) ([]string, error) + func (c *Client) GetPR(ctx context.Context, owner, repo string, number int) (*PRDetails, error) + func (c *Client) GetRawDiff(ctx context.Context, owner, repo string, number int) (string, error) + func (c *Client) GetRepoID(ctx context.Context, owner, repo string) (int64, error) + func (c *Client) GetTree(ctx context.Context, owner, repo, sha string, recursive bool) (*github.Tree, error) + func (c *Client) NewScopedClient(token string) *Client + func (c *Client) PostComment(ctx context.Context, owner, repo string, number int, body string) error + func (c *Client) PostDecisionReview(ctx context.Context, owner, repo string, number int, commitSHA string, ...) (*github.PullRequestReview, error) + func (c *Client) PostSuggestions(ctx context.Context, owner, repo string, number int, commitSHA string, ...) error + func (c *Client) RevokePushCredential(ctx context.Context, cred *PushCredential) error + func (c *Client) RevokeRetrievalCredential(ctx context.Context, cred *RetrievalCredential) error + func (c *Client) ServiceActor(ctx context.Context, owner, repo string) (*ServiceActor, error) + func (c *Client) ServiceActorID(ctx context.Context, owner, repo string) (int64, error) + func (c *Client) SetClock(clk retry.Clock) + func (c *Client) SetGraphQLURL(u string) + func (c *Client) SetRetryPolicy(p retry.Policy) + func (c *Client) UpdateFile(ctx context.Context, owner, repo, path, branch, sha, content, message string) (string, error) + func (c *Client) UpdatePRBody(ctx context.Context, owner, repo string, number int, body string) error + type Comment struct + Body string + CreatedAt time.Time + DiffHunk string + ID int64 + InReplyToID int64 + Line int + Path string + User string + type DecisionWriteError struct + Classification retry.Classification + Err error + func (e *DecisionWriteError) Error() string + func (e *DecisionWriteError) IsUncertain() bool + func (e *DecisionWriteError) Unwrap() error + type DiscussionThread struct + Comments []Comment + DiffHunk string + Line int + Path string + type FileContent struct + Content string + SHA string + type FindOwnedCommentOptions struct + Actor *ServiceActor + BodyDigest string + Marker string + MaxPages int + Owner string + PRNumber int + Repo string + type HeadMovedError struct + ActualHeadOID string + ExpectedHeadOID string + Message string + func (e *HeadMovedError) Error() string + func (e *HeadMovedError) Is(target error) bool + type InlineSuggestion struct + Body string + Line int + Path string + type OwnedCommentMatch struct + Body string + CommentID int64 + Found bool + Reason string + Uncertain bool + type PRDetails struct + Author string + BaseRef string + BaseSHA string + Body string + CloneURL string + CreatedAt time.Time + HeadRef string + HeadRepoID int64 + HeadRepoName string + HeadRepoOwner string + HeadSHA string + Number int + Owner string + Repo string + Title string + func (p *PRDetails) IsFork() bool + type PushCredential struct + ExpiresAt time.Time + Permissions map[string]string + RepoName string + RepoOwner string + RepositoryID int64 + Token string + func (c *PushCredential) IsRevoked() bool + func (c *PushCredential) Zeroize() + type RetrievalCredential struct + ExpiresAt time.Time + Permissions map[string]string + RepoName string + RepoOwner string + RepositoryID int64 + Token string + func (c *RetrievalCredential) IsRevoked() bool + func (c *RetrievalCredential) Zeroize() + type ServiceActor struct + ID int64 + Login string