Documentation
¶
Overview ¶
Package github provides GitHub API client for PR integration
Index ¶
- type Client
- func (c *Client) CreateIssueComment(ctx context.Context, prNumber int, body string) (*gh.IssueComment, error)
- func (c *Client) HasToken() bool
- func (c *Client) ListIssueComments(ctx context.Context, prNumber int) ([]*gh.IssueComment, error)
- func (c *Client) UpdateIssueComment(ctx context.Context, commentID int64, body string) (*gh.IssueComment, error)
- type PRContext
- type PRService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps the GitHub API client
func NewClientFromEnv ¶
func NewClientFromEnv() *Client
NewClientFromEnv creates a client from GitHub Actions environment variables
func (*Client) CreateIssueComment ¶
func (c *Client) CreateIssueComment(ctx context.Context, prNumber int, body string) (*gh.IssueComment, error)
CreateIssueComment creates a new comment on an issue/PR
func (*Client) ListIssueComments ¶
ListIssueComments lists all comments on an issue/PR
func (*Client) UpdateIssueComment ¶
func (c *Client) UpdateIssueComment(ctx context.Context, commentID int64, body string) (*gh.IssueComment, error)
UpdateIssueComment updates an existing comment
type PRContext ¶
type PRContext struct {
Owner string
Repo string
PRNumber int
SourceBranch string
TargetBranch string
RunID string
CommitSHA string
InPR bool
}
PRContext contains information about the current PR context
func DetectPRContext ¶
func DetectPRContext() *PRContext
DetectPRContext detects if we're running in a GitHub Actions PR workflow
type PRService ¶
type PRService struct {
// contains filtered or unexported fields
}
PRService handles GitHub PR comment operations
func NewPRService ¶
NewPRService creates a new PR service with injected dependencies.
func NewPRServiceFromEnv ¶ added in v0.6.5
NewPRServiceFromEnv creates a new PR service with dependencies from environment.
func (*PRService) UpsertComment ¶
func (s *PRService) UpsertComment(plans []ci.ModulePlan, policySummary *ci.PolicySummary) error
UpsertComment creates or updates the terraci comment on the PR