github

package
v0.0.0-...-5d28399 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BranchName

func BranchName(repoName string) string

func BuildDeletePRDescription

func BuildDeletePRDescription(repoName, requester, justification string) string

func BuildDnsPRDescription

func BuildDnsPRDescription(action, zone, recordKey, requester, justification string) string

func BuildDopplerPRDescription

func BuildDopplerPRDescription(action, projectName, requester, justification string) string

func BuildMemberPRDescription

func BuildMemberPRDescription(action, team, username, role, requester, justification string) string

func BuildOrgSettingsPRDescription

func BuildOrgSettingsPRDescription(requester, justification string) string

func BuildPRDescription

func BuildPRDescription(repoName, description, requester, justification string) string

func BuildSettingsPRDescription

func BuildSettingsPRDescription(repoName, requester, justification string) string

func DeleteBranchName

func DeleteBranchName(repoName string) string

func DnsBranchName

func DnsBranchName(action, recordKey string) string

func DopplerBranchName

func DopplerBranchName(action, projectName string) string

func MemberBranchName

func MemberBranchName(action, team, username string) string

func OrgSettingsBranchName

func OrgSettingsBranchName() string

func SettingsBranchName

func SettingsBranchName(repoName string) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(appID, installationID int64, privateKey []byte, owner, repo string) (*Client, error)

NewClient creates a GitHub client authenticated as a GitHub App installation. Outbound HTTP calls are wrapped with otelhttp for distributed trace propagation.

func (*Client) CommentOnPR

func (c *Client) CommentOnPR(ctx context.Context, prNumber int, body string) (err error)

CommentOnPR adds a comment to a pull request.

func (*Client) CreateBranchFromMain

func (c *Client) CreateBranchFromMain(ctx context.Context, branchName string) (err error)

CreateBranchFromMain creates a new branch from the HEAD of main.

func (*Client) CreatePR

func (c *Client) CreatePR(ctx context.Context, branch, title, body string) (_ string, err error)

CreatePR opens a pull request.

func (*Client) GetFileContent

func (c *Client) GetFileContent(ctx context.Context, path string) (_ []byte, _ string, err error)

GetFileContent fetches a file from the default branch.

func (*Client) UpdateFile

func (c *Client) UpdateFile(ctx context.Context, branch, path string, content []byte, fileSHA, commitMsg string) (err error)

UpdateFile creates or updates a file on a branch.

func (*Client) UpdatePRBody

func (c *Client) UpdatePRBody(ctx context.Context, prNumber int, appendText string) (err error)

UpdatePRBody appends text to an existing PR's body.

Jump to

Keyboard shortcuts

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