Documentation
¶
Index ¶
- Constants
- Variables
- func IsErrAlreadyExists(err error) bool
- func IsErrNotFound(err error) bool
- type Artifact
- type Artifacts
- type Comment
- type CommitStatus
- type Event
- type File
- type Github
- type IssueComment
- type IssueCommentEvent
- type Label
- type PullRequest
- type PullRequestEvent
- type Review
- type Reviews
- type Status
Constants ¶
View Source
const ( Opened = "opened" Synchronize = "synchronize" Reopened = "reopened" Closed = "closed" Created = "created" )
View Source
const ( MaxCommentLen = 65536 ActionBotName = "github-actions" )
View Source
const ( ErrorStatus = iota FailureStatus PendingStatus SuccessStatus )
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
func IsErrAlreadyExists ¶
func IsErrNotFound ¶
Types ¶
type CommitStatus ¶
type Github ¶
type Github interface {
CreateIssueComment(ctx context.Context, number int, body string) error
HideIssueComment(ctx context.Context, nodeID string) error
CreateIssueCommentReaction(ctx context.Context, commentID int64, content string) error
CreateLabel(ctx context.Context, name, description, color string) error
DeleteLabel(ctx context.Context, label string) error
GetLabel(ctx context.Context, label string) (*Label, error)
ListReviews(ctx context.Context, number int) (Reviews, error)
ListPullRequestComments(ctx context.Context, number int) ([]*Comment, error)
ListPullRequestsByLabel(ctx context.Context, label string, limit int) ([]*PullRequest, error)
FindPullRequestByLabel(ctx context.Context, label string) (*PullRequest, error)
AddPullRequestLabels(ctx context.Context, number int, labels []string) error
ListFiles(ctx context.Context, number int) ([]string, error)
CreateCommitStatus(ctx context.Context, commitStatus *CommitStatus) error
GetPullRequest(ctx context.Context, number int) (*PullRequest, error)
MultiGetArtifactsByNames(ctx context.Context, names []string) (Artifacts, error)
DownloadArtifact(ctx context.Context, id int64, file io.Writer) error
DeleteArtifactsByNames(ctx context.Context, names []string) error
Event() (Event, error)
}
type IssueComment ¶
type IssueComment struct {
NodeID string
}
type IssueCommentEvent ¶
type IssueCommentEvent struct {
githubv3.IssueCommentEvent
}
func (*IssueCommentEvent) Number ¶
func (e *IssueCommentEvent) Number() int
type PullRequest ¶
type PullRequest struct {
ID int64
Number int
Title string
CreatedAt time.Time
HeadSHA string
MergeableState string
Labels []*Label
}
func (*PullRequest) HasLabel ¶
func (p *PullRequest) HasLabel(labelName string) bool
func (*PullRequest) IsMergeable ¶
func (p *PullRequest) IsMergeable() bool
IsMergeable See: https://github.com/octokit/octokit.net/issues/1763
type PullRequestEvent ¶
type PullRequestEvent struct {
githubv3.PullRequestEvent
}
func (*PullRequestEvent) Number ¶
func (e *PullRequestEvent) Number() int
Click to show internal directories.
Click to hide internal directories.