Documentation
¶
Index ¶
- type CombinedStatus
- type Comment
- type CommitStatus
- type ForgejoProvider
- func (p *ForgejoProvider) CreateComment(owner, repo string, index int64, body string) (*Comment, error)
- func (p *ForgejoProvider) CreatePR(owner, repo, head, base, title, body string) (*PullRequest, error)
- func (p *ForgejoProvider) EditPR(owner, repo string, index int64, title, body string) (*PullRequest, error)
- func (p *ForgejoProvider) GetCIFailureDetails(owner, repo, sha string) ([]*JobFailure, error)
- func (p *ForgejoProvider) GetCombinedStatus(owner, repo, ref string) (*CombinedStatus, error)
- func (p *ForgejoProvider) GetPR(owner, repo string, index int64) (*PullRequest, error)
- func (p *ForgejoProvider) ListComments(owner, repo string, index int64) ([]*Comment, error)
- func (p *ForgejoProvider) MergePR(owner, repo string, index int64, deleteBranch bool) error
- func (p *ForgejoProvider) Name() string
- type GitHubProvider
- func (p *GitHubProvider) CreateComment(owner, repo string, index int64, body string) (*Comment, error)
- func (p *GitHubProvider) CreatePR(owner, repo, head, base, title, body string) (*PullRequest, error)
- func (p *GitHubProvider) EditPR(owner, repo string, index int64, title, body string) (*PullRequest, error)
- func (p *GitHubProvider) GetCIFailureDetails(owner, repo, sha string) ([]*JobFailure, error)
- func (p *GitHubProvider) GetCombinedStatus(owner, repo, ref string) (*CombinedStatus, error)
- func (p *GitHubProvider) GetPR(owner, repo string, index int64) (*PullRequest, error)
- func (p *GitHubProvider) ListComments(owner, repo string, index int64) ([]*Comment, error)
- func (p *GitHubProvider) MergePR(owner, repo string, index int64, deleteBranch bool) error
- func (p *GitHubProvider) Name() string
- type JobFailure
- type Provider
- type ProviderType
- type PullRequest
- type RepoInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CombinedStatus ¶
type CombinedStatus struct {
State string // Overall: "pending", "success", "error", "failure"
Statuses []*CommitStatus
}
CombinedStatus represents the overall status of all checks on a commit.
type CommitStatus ¶
type CommitStatus struct {
Context string // Check name (e.g. "ci/woodpecker", "lint")
State string // "pending", "success", "error", "failure"
Description string
TargetURL string
}
CommitStatus represents the status of a single CI check on a commit.
type ForgejoProvider ¶
type ForgejoProvider struct {
// contains filtered or unexported fields
}
func (*ForgejoProvider) CreateComment ¶
func (*ForgejoProvider) CreatePR ¶
func (p *ForgejoProvider) CreatePR(owner, repo, head, base, title, body string) (*PullRequest, error)
func (*ForgejoProvider) EditPR ¶
func (p *ForgejoProvider) EditPR(owner, repo string, index int64, title, body string) (*PullRequest, error)
func (*ForgejoProvider) GetCIFailureDetails ¶
func (p *ForgejoProvider) GetCIFailureDetails(owner, repo, sha string) ([]*JobFailure, error)
func (*ForgejoProvider) GetCombinedStatus ¶
func (p *ForgejoProvider) GetCombinedStatus(owner, repo, ref string) (*CombinedStatus, error)
func (*ForgejoProvider) GetPR ¶
func (p *ForgejoProvider) GetPR(owner, repo string, index int64) (*PullRequest, error)
func (*ForgejoProvider) ListComments ¶
func (p *ForgejoProvider) ListComments(owner, repo string, index int64) ([]*Comment, error)
func (*ForgejoProvider) MergePR ¶
func (p *ForgejoProvider) MergePR(owner, repo string, index int64, deleteBranch bool) error
func (*ForgejoProvider) Name ¶
func (p *ForgejoProvider) Name() string
type GitHubProvider ¶
type GitHubProvider struct {
// contains filtered or unexported fields
}
func (*GitHubProvider) CreateComment ¶
func (*GitHubProvider) CreatePR ¶
func (p *GitHubProvider) CreatePR(owner, repo, head, base, title, body string) (*PullRequest, error)
func (*GitHubProvider) EditPR ¶
func (p *GitHubProvider) EditPR(owner, repo string, index int64, title, body string) (*PullRequest, error)
func (*GitHubProvider) GetCIFailureDetails ¶
func (p *GitHubProvider) GetCIFailureDetails(owner, repo, sha string) ([]*JobFailure, error)
func (*GitHubProvider) GetCombinedStatus ¶
func (p *GitHubProvider) GetCombinedStatus(owner, repo, ref string) (*CombinedStatus, error)
func (*GitHubProvider) GetPR ¶
func (p *GitHubProvider) GetPR(owner, repo string, index int64) (*PullRequest, error)
func (*GitHubProvider) ListComments ¶
func (p *GitHubProvider) ListComments(owner, repo string, index int64) ([]*Comment, error)
func (*GitHubProvider) MergePR ¶
func (p *GitHubProvider) MergePR(owner, repo string, index int64, deleteBranch bool) error
func (*GitHubProvider) Name ¶
func (p *GitHubProvider) Name() string
type JobFailure ¶
type JobFailure struct {
WorkflowName string
JobName string
LogTail string // last ~50 lines of job log (best-effort)
HTMLURL string
}
JobFailure describes a single failed CI job with optional log tail.
type Provider ¶
type Provider interface {
Name() string
CreatePR(owner, repo, head, base, title, body string) (*PullRequest, error)
EditPR(owner, repo string, index int64, title, body string) (*PullRequest, error)
GetPR(owner, repo string, index int64) (*PullRequest, error)
MergePR(owner, repo string, index int64, deleteBranch bool) error
CreateComment(owner, repo string, index int64, body string) (*Comment, error)
ListComments(owner, repo string, index int64) ([]*Comment, error)
GetCombinedStatus(owner, repo, ref string) (*CombinedStatus, error)
GetCIFailureDetails(owner, repo, sha string) ([]*JobFailure, error)
}
func NewForgejoProvider ¶
func NewGitHubProvider ¶
func NewProvider ¶
func NewProviderByName ¶
type ProviderType ¶
type ProviderType string
const ( ProviderForgejo ProviderType = "forgejo" ProviderGitHub ProviderType = "github" )
type PullRequest ¶
type RepoInfo ¶
type RepoInfo struct {
Owner string
Repo string
Provider ProviderType
Host string
DefaultBranch string
}
func DetectProvider ¶
func ParseRemoteURL ¶
Click to show internal directories.
Click to hide internal directories.