Documentation
¶
Overview ¶
Package github provides a client for syncing compliance findings with GitHub issues.
It wraps go-github to:
- Create tracking issues for findings
- Discover linked issues/PRs from comments
- Sync issue state back to finding status
- Collect evidence from closed issues/PRs (merge info)
Index ¶
- type Client
- func (c *Client) AddLabels(ctx context.Context, repo string, number int, labels []string) error
- func (c *Client) CreateIssue(ctx context.Context, repo, title, body string, labels []string) (int, error)
- func (c *Client) DiscoverCommentLinks(ctx context.Context, repo string, number int) ([]IssueRef, []IssueRef, error)
- func (c *Client) EnsureLabels(ctx context.Context, repo string, labels map[string]string) error
- func (c *Client) GetIssueState(ctx context.Context, repo string, number int) (*IssueState, error)
- func (c *Client) GetPRMergeInfo(ctx context.Context, repo string, number int) (bool, string, string, error)
- type IssueRef
- type IssueState
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 for compliance operations.
func New ¶
New creates a Client. It expects GITHUB_TOKEN in the environment (via go-github default).
func NewWithToken ¶
NewWithToken creates a Client with an explicit token.
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(ctx context.Context, repo, title, body string, labels []string) (int, error)
CreateIssue creates a new GitHub issue and returns the issue number.
func (*Client) DiscoverCommentLinks ¶
func (c *Client) DiscoverCommentLinks(ctx context.Context, repo string, number int) ([]IssueRef, []IssueRef, error)
DiscoverCommentLinks finds issue/PR references in comments on a tracking issue. Returns (issues, prs) that are not self-references.
func (*Client) EnsureLabels ¶
EnsureLabels creates labels that don't exist yet.
func (*Client) GetIssueState ¶
GetIssueState fetches the state of a single issue.
Click to show internal directories.
Click to hide internal directories.