github

package
v0.0.0-...-dbeda81 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package github provides GitHub API client functionality.

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 provides methods to interact with the GitHub API.

func New

func New(ctx context.Context, pat string, log *logger.Logger) *Client

New creates a new GitHub API client.

func (*Client) CreateBlob

func (c *Client) CreateBlob(ctx context.Context, org, repo, contents string) (string, error)

CreateBlob creates a blob and returns its SHA.

func (*Client) CreateBranch

func (c *Client) CreateBranch(ctx context.Context, org, repo, branchName, sha string) error

CreateBranch creates a new branch in the repository.

func (*Client) CreateCommit

func (c *Client) CreateCommit(ctx context.Context, org, repo, message, treeSha, parentSha string) (string, error)

CreateCommit creates a commit with the given tree and parent.

func (*Client) CreateFile

func (c *Client) CreateFile(ctx context.Context, org, repo, branch, path, contents string) error

CreateFile creates or updates a file in the repository.

func (*Client) CreateTree

func (c *Client) CreateTree(ctx context.Context, org, repo, baseTreeSha string, entries []*github.TreeEntry) (string, error)

CreateTree creates a tree with the given entries.

func (*Client) DeleteBranch

func (c *Client) DeleteBranch(ctx context.Context, org, repo, branchName string) error

DeleteBranch deletes a branch from the repository.

func (*Client) DeleteRef

func (c *Client) DeleteRef(ctx context.Context, org, repo, ref string) error

DeleteRef deletes a reference.

func (*Client) DeleteSecret

func (c *Client) DeleteSecret(ctx context.Context, org, repo, secretName string) error

DeleteSecret deletes a secret from the repository.

func (*Client) GetCommitSha

func (c *Client) GetCommitSha(ctx context.Context, org, repo, branch string) (string, error)

GetCommitSha retrieves the commit SHA for a given branch.

func (*Client) GetDefaultBranch

func (c *Client) GetDefaultBranch(ctx context.Context, org, repo string) (string, error)

GetDefaultBranch retrieves the default branch of a repository.

func (*Client) GetTreeSha

func (c *Client) GetTreeSha(ctx context.Context, org, repo, commitSha string) (string, error)

GetTreeSha retrieves the tree SHA for a commit.

func (*Client) ListRepoSecrets

func (c *Client) ListRepoSecrets(ctx context.Context, org, repo string) ([]string, error)

ListRepoSecrets retrieves all secrets in the repository.

func (*Client) UpdateRef

func (c *Client) UpdateRef(ctx context.Context, org, repo, ref, sha string) error

UpdateRef updates a reference to point to a new commit.

Jump to

Keyboard shortcuts

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