github

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package github provides utilities for interacting with the GitHub API.

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.

func NewClient

func NewClient(ctx context.Context, token string) (*Client, error)

NewClient creates a new GitHub client with the provided token.

func (*Client) CreateReleasePR

func (c *Client) CreateReleasePR(ctx context.Context, req PRRequest) (*PRResult, error)

CreateReleasePR creates a new branch with the modified files and opens a PR.

type PRRequest

type PRRequest struct {
	Owner      string   // GitHub repository owner (required)
	Repo       string   // GitHub repository name (required)
	BaseBranch string   // Base branch for the PR (required, e.g., "main")
	HeadBranch string   // Feature branch to create (required)
	Title      string   // PR title (required)
	Body       string   // PR body/description
	Files      []string // Files to commit (required, must not be empty)
}

PRRequest contains the parameters for creating a pull request. All fields except Body are required.

func (*PRRequest) Validate added in v1.0.10

func (r *PRRequest) Validate() error

Validate checks that all required fields are set.

type PRResult

type PRResult struct {
	Number int
	URL    string
}

PRResult contains the result of creating a pull request.

Jump to

Keyboard shortcuts

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