github

package
v13.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect(originURL *giturl.Parts, hostingPlatform configdomain.HostingPlatform) bool

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

func GetAPIToken

func GetAPIToken(gitConfigToken configdomain.GitHubToken) 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 {
	hostingdomain.Config
	APIToken   configdomain.GitHubToken
	MainBranch gitdomain.LocalBranchName
	// 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 hostingdomain.Proposal) string

func (*Connector) FindProposal

func (self *Connector) FindProposal(branch, target gitdomain.LocalBranchName) (*hostingdomain.Proposal, error)

func (*Connector) NewProposalURL

func (self *Connector) NewProposalURL(branch, parentBranch gitdomain.LocalBranchName) (string, error)

func (*Connector) RepositoryURL

func (self *Connector) RepositoryURL() string

func (*Connector) SquashMergeProposal

func (self *Connector) SquashMergeProposal(number int, message gitdomain.CommitMessage) (err error)

func (*Connector) UpdateProposalTarget

func (self *Connector) UpdateProposalTarget(number int, target gitdomain.LocalBranchName) error

type NewConnectorArgs

type NewConnectorArgs struct {
	APIToken        configdomain.GitHubToken
	HostingPlatform configdomain.HostingPlatform
	Log             print.Logger
	MainBranch      gitdomain.LocalBranchName
	OriginURL       *giturl.Parts
}

Jump to

Keyboard shortcuts

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