github

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package github provides GitHub API utilities for marketplace submissions. This package wraps github.com/grokify/gogithub for marketplace-specific operations.

Index

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 NewClient

func NewClient(token string) *Client

NewClient creates a new GitHub client with the given token.

func (*Client) CreateBranch

func (c *Client) CreateBranch(ctx context.Context, owner, repoName, branch, baseSHA string) error

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

func (c *Client) GetAuthenticatedUser(ctx context.Context) (string, error)

GetAuthenticatedUser returns the authenticated user's login.

func (*Client) GetBranchSHA

func (c *Client) GetBranchSHA(ctx context.Context, owner, repoName, branch string) (string, error)

GetBranchSHA returns the SHA of the given branch.

func (*Client) GetDefaultBranch

func (c *Client) GetDefaultBranch(ctx context.Context, owner, repoName string) (string, error)

GetDefaultBranch returns the default branch of a repository.

func (*Client) SetDryRun

func (c *Client) SetDryRun(dryRun bool)

SetDryRun enables or disables dry run mode.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL