github

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

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 our specific functionality

func NewClient

func NewClient(token string) *Client

NewClient creates a new GitHub API client with authentication

func NewClientWithConfig

func NewClientWithConfig(token string, config *Config) *Client

NewClientWithConfig creates a new GitHub API client with authentication and configuration

func (*Client) CreatePullRequest

func (c *Client) CreatePullRequest(repo Repository, title, body, headBranch string) error

CreatePullRequest creates a pull request with the given changes

func (*Client) GetRepositoryCustomProperties added in v1.0.0

func (c *Client) GetRepositoryCustomProperties(owner, repo string, properties []string) (map[string]string, error)

GetRepositoryCustomProperties fetches custom properties for a repository using the GitHub Custom Properties API

func (*Client) GetTagsForRepo

func (c *Client) GetTagsForRepo(owner, repo string) (map[string]string, error)

GetTagsForRepo gets all tags for a repository and returns them with their commit SHAs

func (*Client) GetWorkflowFiles

func (c *Client) GetWorkflowFiles(repo Repository) ([]WorkflowFile, error)

GetWorkflowFiles retrieves all workflow files from a repository's .github/workflows directory

func (*Client) ListRepositories

func (c *Client) ListRepositories(owner string) ([]Repository, error)

ListRepositories gets all repositories for a given owner (user or org)

func (*Client) ListRepositoriesWithCustomProperties added in v1.0.0

func (c *Client) ListRepositoriesWithCustomProperties(owner string, customProperties []string) ([]Repository, error)

ListRepositoriesWithCustomProperties gets all repositories for a given owner and optionally fetches custom properties

func (*Client) ResolveRef

func (c *Client) ResolveRef(owner, repo, ref string) (string, error)

ResolveRef resolves a git reference (tag, branch, or SHA) to a commit SHA

type Config

type Config struct {
	Verbose bool
}

Config holds configuration options for the GitHub client

type Repository

type Repository struct {
	Owner            string            `json:"owner"`
	Name             string            `json:"name"`
	DefaultBranch    string            `json:"default_branch"`
	FullName         string            `json:"full_name"`
	CustomProperties map[string]string `json:"custom_properties,omitempty"`
}

Repository represents a GitHub repository with relevant metadata

type WorkflowFile

type WorkflowFile struct {
	Repository Repository
	Path       string
	Content    string
}

WorkflowFile represents a workflow file found in a repository

Jump to

Keyboard shortcuts

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