gh

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDraftRelease

func CreateDraftRelease(owner, repo, title, body, tag string, conf *config.Config) error

func OpenPullRequest

func OpenPullRequest(data map[string]string, owner string, repo string, conf *config.Config) (int, error)

func SubmitPullRequestReview

func SubmitPullRequestReview(owner, repo string, pullRequestNumber int, review *PullRequestReview, conf *config.Config) error

Types

type Comment

type Comment struct {
	ID        int    `json:"id"`
	Body      string `json:"body"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
	// The username of the user who made the comment. This is optional.
	Username string `json:"username,omitempty"`
}

type Issue

type Issue struct {
	Number    int    `json:"number"`
	Title     string `json:"title"`
	Body      string `json:"body"`
	State     string `json:"state"`
	CreatedAt string `json:"created_at"`
	UpdatedAt string `json:"updated_at"`
}

type IssueWithComments

type IssueWithComments struct {
	Issue    Issue     `json:"issue"`
	Comments []Comment `json:"comments"`
}

func GetIssue

func GetIssue(owner, repo string, issueNumber int, conf *config.Config) (*IssueWithComments, error)

type PullRequestReview

type PullRequestReview struct {
	// The body of the review. This is optional.
	Body string `json:"body,omitempty"`
	// The event to perform on the pull request. This can be one of:
	// "APPROVE", "REQUEST_CHANGES", "COMMENT", or "DISMISS".
	Event string `json:"event,omitempty"`
	// An array of comments to add to the review. This is optional.
	Comments []*ReviewComment `json:"comments,omitempty"`
	// The commit ID of the pull request. This is required for reviews on multi-commit pull requests.
	CommitID string `json:"commit_id,omitempty"`
	// The path to the file being commented on. This is required for single-file reviews.
	Path string `json:"path,omitempty"`
	// The position in the diff to comment on. This is required for single-file reviews.
	Position int `json:"position,omitempty"`
	// The ID of an existing review to update. This is optional.
	ReviewID int `json:"review_id,omitempty"`
	// Set to true to submit the review and mark the pull request as reviewed. This is optional.
	Submit *bool `json:"submit,omitempty"`
	// Set to true to request changes to the pull request. This is optional.
	RequestChanges *bool `json:"request_changes,omitempty"`
}

type ReviewComment

type ReviewComment struct {
	// The body of the comment.
	Body string `json:"body"`
	// The relative path to the file that this comment applies to.
	Path string `json:"path"`
	// The line index in the diff to which the comment applies. Note that this is not a line number in the file itself.
	Position int `json:"position"`
}

Jump to

Keyboard shortcuts

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