github

package
v18.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package github provides the forge connector for GitHub.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(remoteURL giturl.Parts) bool

Detect indicates whether the current repository is hosted on a GitHub server.

func GetAPIToken

func GetAPIToken(gitConfigToken Option[configdomain.GitHubToken]) Option[configdomain.GitHubToken]

getGitHubApiToken returns the GitHub API token to use. It first checks the GITHUB_TOKEN environment variable. If that is not set, it checks the GITHUB_AUTH_TOKEN environment variable. If that is not set, it checks the git config.

Types

type Connector

type Connector struct {
	forgedomain.Data
	APIToken Option[configdomain.GitHubToken]
	// contains filtered or unexported fields
}

Connector provides standardized connectivity for the given repository (github.com/owner/repo) via the GitHub API.

func NewConnector

func NewConnector(args NewConnectorArgs) (Connector, error)

NewConnector provides a fully configured GithubConnector instance if the current repo is hosted on GitHub, otherwise nil.

func (Connector) DefaultProposalMessage

func (self Connector) DefaultProposalMessage(proposal forgedomain.Proposal) string

func (Connector) FindProposalFn

func (self Connector) FindProposalFn() Option[func(branch, target gitdomain.LocalBranchName) (Option[forgedomain.Proposal], error)]

func (Connector) NewProposalURL

func (self Connector) NewProposalURL(branch, parentBranch, mainBranch gitdomain.LocalBranchName, proposalTitle gitdomain.ProposalTitle, proposalBody gitdomain.ProposalBody) (string, error)

func (Connector) RepositoryURL

func (self Connector) RepositoryURL() string

func (Connector) SearchProposalFn

func (self Connector) SearchProposalFn() Option[func(branch gitdomain.LocalBranchName) (Option[forgedomain.Proposal], error)]

func (Connector) SquashMergeProposalFn

func (self Connector) SquashMergeProposalFn() Option[func(number int, message gitdomain.CommitMessage) (err error)]

func (Connector) UpdateProposalSourceFn

func (self Connector) UpdateProposalSourceFn() Option[func(number int, _ gitdomain.LocalBranchName, finalMessages stringslice.Collector) error]

func (Connector) UpdateProposalTargetFn

func (self Connector) UpdateProposalTargetFn() Option[func(number int, target gitdomain.LocalBranchName, _ stringslice.Collector) error]

type NewConnectorArgs

type NewConnectorArgs struct {
	APIToken  Option[configdomain.GitHubToken]
	Log       print.Logger
	RemoteURL giturl.Parts
}

Jump to

Keyboard shortcuts

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