github

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package github provides functionality for interacting with the GitHub API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractRepoInfo

func ExtractRepoInfo(remoteURL string) (string, string, error)

ExtractRepoInfo extracts owner and repo name from a Git remote URL or the current repository

func InstallPostTagHook

func InstallPostTagHook() error

InstallPostTagHook installs a Git hook that runs after tags are created to create GitHub releases automatically with enhanced release notes

Types

type Client

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

Client represents a GitHub API client

func NewClient

func NewClient() (*Client, error)

NewClient creates a new GitHub API client

func NewClientWithoutAuth added in v0.4.1

func NewClientWithoutAuth() *Client

NewClientWithoutAuth creates a new GitHub API client without authentication for accessing public resources

func (*Client) AreAllWorkflowsComplete added in v0.3.5

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

AreAllWorkflowsComplete checks if all workflows for a ref have completed (success or failure)

func (*Client) CreateRelease

func (c *Client) CreateRelease(owner, repo, tagName, name, body string, draft, prerelease bool) (map[string]interface{}, error)

CreateRelease creates a new release in the specified repository

func (*Client) GetLatestRelease added in v0.4.1

func (c *Client) GetLatestRelease(owner, repo string) (map[string]interface{}, error)

GetLatestRelease gets the latest release from a GitHub repository

func (*Client) GetRepository

func (c *Client) GetRepository(owner, repo string) (map[string]interface{}, error)

GetRepository retrieves a repository by owner and repo name

func (*Client) GetUser

func (c *Client) GetUser() (map[string]interface{}, error)

GetUser retrieves the authenticated user's information

func (*Client) GetWorkflowRunsForRef added in v0.3.5

func (c *Client) GetWorkflowRunsForRef(owner, repo, ref string) ([]map[string]interface{}, error)

GetWorkflowRunsForRef gets the workflow runs triggered by a specific git ref (tag/branch)

func (*Client) IsAuthenticated

func (c *Client) IsAuthenticated() (bool, error)

IsAuthenticated checks if the client has a valid GitHub token

func (*Client) WaitForWorkflowsToComplete added in v0.3.5

func (c *Client) WaitForWorkflowsToComplete(owner, repo, ref string, maxWaitSeconds int) error

WaitForWorkflowsToComplete waits for all workflows to complete with a max wait time

type ReleaseManager

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

ReleaseManager handles GitHub release operations

func NewReleaseManager

func NewReleaseManager(config config.Config) (*ReleaseManager, error)

NewReleaseManager creates a new release manager

func (*ReleaseManager) UpdateReleaseNotes

func (m *ReleaseManager) UpdateReleaseNotes(tagName string, skipApproval bool) error

UpdateReleaseNotes creates or updates GitHub release notes with AI-generated content

func (*ReleaseManager) UpdateReleaseNotesWithWorkflowCheck added in v0.3.5

func (m *ReleaseManager) UpdateReleaseNotesWithWorkflowCheck(tagName string, skipApproval bool, waitForWorkflows bool, maxWaitSeconds int) error

UpdateReleaseNotesWithWorkflowCheck creates or updates GitHub release notes after checking workflow status

Jump to

Keyboard shortcuts

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