Documentation
¶
Overview ¶
Package github provides GitHub API utilities for marketplace submissions. This package wraps github.com/grokify/gogithub for marketplace-specific operations.
Index ¶
- type Client
- func (c *Client) CreateBranch(ctx context.Context, owner, repoName, branch, baseSHA string) error
- func (c *Client) CreateCommit(ctx context.Context, owner, repoName, branch, message string, ...) (string, error)
- func (c *Client) CreatePR(ctx context.Context, ...) (*github.PullRequest, error)
- func (c *Client) EnsureFork(ctx context.Context, upstreamOwner, upstreamRepo, forkOwner string) (string, string, error)
- func (c *Client) GetAuthenticatedUser(ctx context.Context) (string, error)
- func (c *Client) GetBranchSHA(ctx context.Context, owner, repoName, branch string) (string, error)
- func (c *Client) GetDefaultBranch(ctx context.Context, owner, repoName string) (string, error)
- func (c *Client) SetDryRun(dryRun bool)
- type FileContent
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 with marketplace-specific operations.
func (*Client) CreateBranch ¶
CreateBranch creates a new branch from the given base SHA.
func (*Client) CreateCommit ¶
func (c *Client) CreateCommit(ctx context.Context, owner, repoName, branch, message string, files []FileContent) (string, error)
CreateCommit creates a commit with the given files.
func (*Client) CreatePR ¶
func (c *Client) CreatePR(ctx context.Context, upstreamOwner, upstreamRepo, forkOwner, branch, baseBranch, title, body string) (*github.PullRequest, error)
CreatePR creates a pull request.
func (*Client) EnsureFork ¶
func (c *Client) EnsureFork(ctx context.Context, upstreamOwner, upstreamRepo, forkOwner string) (string, string, error)
EnsureFork ensures a fork exists for the given repository. Returns the fork owner and repo name.
func (*Client) GetAuthenticatedUser ¶
GetAuthenticatedUser returns the authenticated user's login.
func (*Client) GetBranchSHA ¶
GetBranchSHA returns the SHA of the given branch.
func (*Client) GetDefaultBranch ¶
GetDefaultBranch returns the default branch of a repository.
type FileContent ¶
type FileContent = repo.FileContent
FileContent represents a file to be committed.
func ReadLocalFiles ¶
func ReadLocalFiles(dir, prefix string) ([]FileContent, error)
ReadLocalFiles reads all files from a local directory recursively.