Documentation
¶
Overview ¶
Package github provides request/response/payload types, and Timpani activity names and wrapper functions, for interacting with GitHub via its REST API.
Index ¶
- Constants
- func IssuesCommentsDelete(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int) error
- func PullRequestsCommentsDelete(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int) error
- func PullRequestsReviewsDelete(ctx workflow.Context, thrippyLinkID, owner, repo string, prID, reviewID int) error
- type App
- type AutoMerge
- type Branch
- type Commit
- type CommitDetails
- type CommitParent
- type CommitUser
- type File
- type Issue
- type IssueComment
- type IssuesCommentsCreateRequest
- type IssuesCommentsDeleteRequest
- type IssuesCommentsUpdateRequest
- type PullComment
- func PullRequestsCommentsCreate(ctx workflow.Context, req PullRequestsCommentsCreateRequest) (*PullComment, error)
- func PullRequestsCommentsCreateReply(ctx workflow.Context, req PullRequestsCommentsCreateReplyRequest) (*PullComment, error)
- func PullRequestsCommentsUpdate(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int, ...) (*PullComment, error)
- type PullRequest
- type PullRequestLinks
- type PullRequestsCommentsCreateReplyRequest
- type PullRequestsCommentsCreateRequest
- type PullRequestsCommentsDeleteRequest
- type PullRequestsCommentsRequest
- type PullRequestsCommentsUpdateRequest
- type PullRequestsGetRequest
- type PullRequestsListCommitsRequest
- type PullRequestsListFilesRequest
- type PullRequestsMergeRequest
- type PullRequestsMergeResponse
- type PullRequestsRequest
- type PullRequestsReviewsCreateRequest
- type PullRequestsReviewsDeleteRequest
- type PullRequestsReviewsDismissRequest
- type PullRequestsReviewsRequest
- type PullRequestsReviewsSubmitRequest
- type PullRequestsReviewsUpdateRequest
- type PullRequestsUpdateRequest
- type Reactions
- type Repository
- type Review
- func PullRequestsReviewsCreate(ctx workflow.Context, req PullRequestsReviewsCreateRequest) (*Review, error)
- func PullRequestsReviewsDismiss(ctx workflow.Context, req PullRequestsReviewsDismissRequest) (*Review, error)
- func PullRequestsReviewsSubmit(ctx workflow.Context, req PullRequestsReviewsSubmitRequest) (*Review, error)
- func PullRequestsReviewsUpdate(ctx workflow.Context, req PullRequestsReviewsUpdateRequest) (*Review, error)
- type Team
- type User
- type UsersGetRequest
- type UsersListRequest
- type Verification
Constants ¶
const ( IssuesCommentsCreateActivityName = "github.issues.comments.create" IssuesCommentsDeleteActivityName = "github.issues.comments.delete" IssuesCommentsUpdateActivityName = "github.issues.comments.update" )
const ( PullRequestsGetActivityName = "github.pulls.get" PullRequestsListCommitsActivityName = "github.pulls.listCommits" PullRequestsListFilesActivityName = "github.pulls.listFiles" PullRequestsMergeActivityName = "github.pulls.merge" PullRequestsUpdateActivityName = "github.pulls.update" PullRequestsCommentsCreateActivityName = "github.pulls.reviewComments.create" PullRequestsCommentsCreateReplyActivityName = "github.pulls.reviewComments.createReply" PullRequestsCommentsDeleteActivityName = "github.pulls.reviewComments.delete" PullRequestsCommentsUpdateActivityName = "github.pulls.reviewComments.update" PullRequestsReviewsCreateActivityName = "github.pulls.reviews.create" PullRequestsReviewsDeleteActivityName = "github.pulls.reviews.deletePending" PullRequestsReviewsDismissActivityName = "github.pulls.reviews.dismiss" PullRequestsReviewsSubmitActivityName = "github.pulls.reviews.submitPending" PullRequestsReviewsUpdateActivityName = "github.pulls.reviews.update" )
const ( UsersGetActivityName = "github.users.get" UsersListActivityName = "github.users.list" )
Variables ¶
This section is empty.
Functions ¶
func IssuesCommentsDelete ¶
func IssuesCommentsDelete(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int) error
IssuesCommentsDelete is based on: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#delete-an-issue-comment
func PullRequestsCommentsDelete ¶ added in v1.11.0
func PullRequestsCommentsDelete(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int) error
PullRequestsCommentsDelete is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#delete-a-review-comment-for-a-pull-request
func PullRequestsReviewsDelete ¶
func PullRequestsReviewsDelete(ctx workflow.Context, thrippyLinkID, owner, repo string, prID, reviewID int) error
PullRequestsReviewsDelete is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#delete-a-pending-review-for-a-pull-request
Types ¶
type App ¶ added in v1.11.0
type App struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
ExternalURL string `json:"external_url"`
Slug string `json:"slug"`
Name string `json:"name"`
Description string `json:"description,omitempty"`
Owner User `json:"owner"`
Permissions map[string]string `json:"permissions,omitempty"`
Events []string `json:"events,omitempty"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
App is based on: https://docs.github.com/en/rest/apps/apps?apiVersion=2022-11-28
type AutoMerge ¶
type AutoMerge struct {
EnabledBy User `json:"enabled_by"`
MergeMethod string `json:"merge_method"`
CommitTitle string `json:"commit_title"`
CommitMessage string `json:"commit_message"`
}
AutoMerge is used in PullRequest.
type Branch ¶
type Branch struct {
Label string `json:"label"`
Ref string `json:"ref"`
SHA string `json:"sha"`
Repo Repository `json:"repo"`
User User `json:"user"`
}
Branch is used in PullRequest.
type Commit ¶ added in v1.12.0
type Commit struct {
SHA string `json:"sha"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
Commit CommitDetails `json:"commit"`
Author User `json:"author"`
Committer User `json:"committer"`
Parents []CommitParent `json:"parents"`
}
Commit is based on:
- https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28
- https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-commits-on-a-pull-request
func PullRequestsListCommits ¶ added in v1.12.0
func PullRequestsListCommits(ctx workflow.Context, thrippyLinkID, owner, repo string, prID int) ([]Commit, error)
PullRequestsListCommits is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-commits-on-a-pull-request
Pagination is handled internally, but the results are limited to a maximum of 250 commits. To receive a complete list, call [CommitsList].
type CommitDetails ¶ added in v1.12.0
type CommitDetails struct {
Message string `json:"message"`
CommentCount int `json:"comment_count"`
Verification Verification `json:"verification"`
}
CommitDetails is based on:
type CommitParent ¶ added in v1.12.0
CommitParent is based on:
type CommitUser ¶ added in v1.12.0
type CommitUser struct {
Name string `json:"name"`
Email string `json:"email"`
Username string `json:"username,omitempty"`
Date time.Time `json:"date,omitzero"`
When time.Time `json:"when,omitzero"`
}
CommitUser is based on:
type File ¶ added in v1.12.0
type File struct {
SHA string `json:"sha"`
Filename string `json:"filename"`
Status string `json:"status"` // "added", "modified", "removed", "renamed".
Additions int `json:"additions"`
Deletions int `json:"deletions"`
Changes int `json:"changes"`
BlobURL string `json:"blob_url"`
RawURL string `json:"raw_url"`
ContentsURL string `json:"contents_url"`
Patch string `json:"patch,omitempty"`
}
File is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files
func PullRequestsListFiles ¶ added in v1.12.0
func PullRequestsListFiles(ctx workflow.Context, thrippyLinkID, owner, repo string, prID int) ([]File, error)
PullRequestsListFiles is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files
Pagination is handled internally, but the results are limited to a maximum of 3000 files.
type Issue ¶
type Issue struct {
ID int `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
Number int `json:"number"`
Title string `json:"title"`
Body string `json:"body"`
Reactions *Reactions `json:"reactions,omitempty"`
State string `json:"state"` // "open" or "closed".
StateReason string `json:"state_reason,omitempty"` // "completed", "not_planned".
Draft bool `json:"draft,omitempty"`
Locked bool `json:"locked,omitempty"`
ActiveLockReason string `json:"active_lock_reason,omitempty"` // "off_topic", "too_heated", "resolved", "spam".
Comments int `json:"comments,omitempty"`
PullRequest *PullRequestLinks `json:"pull_request,omitempty"`
User User `json:"user"`
Assignee *User `json:"assignee,omitempty"`
Assignees []User `json:"assignees,omitempty"`
ClosedBy *User `json:"closed_by,omitempty"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
ClosedAt time.Time `json:"closed_at,omitzero"`
PerformedViaGitHubApp *App `json:"performed_via_github_app,omitempty"`
}
Issue is based on:
type IssueComment ¶
type IssueComment struct {
ID int `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
Body string `json:"body"`
Reactions *Reactions `json:"reactions,omitempty"`
User User `json:"user"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
PerformedViaGitHubApp *App `json:"performed_via_github_app,omitempty"`
}
IssueComment is based on:
- https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28
- https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment
func IssuesCommentsCreate ¶
func IssuesCommentsCreate(ctx workflow.Context, thrippyLinkID, owner, repo string, issue int, body string) (*IssueComment, error)
IssuesCommentsCreate is based on: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
func IssuesCommentsUpdate ¶
func IssuesCommentsUpdate(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int, body string) (*IssueComment, error)
IssuesCommentsUpdate is based on: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment
type IssuesCommentsCreateRequest ¶
type IssuesCommentsCreateRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Owner string `json:"owner"`
Repo string `json:"repo"`
IssueNumber int `json:"issue_number"`
Body string `json:"body"`
}
IssuesCommentsCreateRequest is based on: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#create-an-issue-comment
type IssuesCommentsDeleteRequest ¶
type IssuesCommentsDeleteRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Owner string `json:"owner"`
Repo string `json:"repo"`
CommentID int `json:"comment_id"`
}
IssuesCommentsDeleteRequest is based on: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#delete-an-issue-comment
type IssuesCommentsUpdateRequest ¶
type IssuesCommentsUpdateRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Owner string `json:"owner"`
Repo string `json:"repo"`
CommentID int `json:"comment_id"`
Body string `json:"body"`
}
IssuesCommentsUpdateRequest is based on: https://docs.github.com/en/rest/issues/comments?apiVersion=2022-11-28#update-an-issue-comment
type PullComment ¶
type PullComment struct {
ID int `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
PullRequestReviewID int `json:"pull_request_review_id"`
InReplyTo *int `json:"in_reply_to_id,omitempty"`
CommitID string `json:"commit_id"`
OriginalCommitID string `json:"original_commit_id"`
Path string `json:"path"`
SubjectType string `json:"subject_type,omitempty"`
DiffHunk string `json:"diff_hunk,omitempty"`
User User `json:"user"`
Body string `json:"body"`
Reactions *Reactions `json:"reactions,omitempty"`
StartLine int `json:"start_line,omitzero"`
OriginalStartLine int `json:"original_start_line,omitzero"`
StartSide string `json:"start_side,omitzero"`
Line int `json:"line,omitzero"`
OriginalLine int `json:"original_line,omitzero"`
Side string `json:"side,omitzero"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
PullComment is based on:
- https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28
- https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review_comment
func PullRequestsCommentsCreate ¶
func PullRequestsCommentsCreate(ctx workflow.Context, req PullRequestsCommentsCreateRequest) (*PullComment, error)
PullRequestsCommentsCreate is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request
func PullRequestsCommentsCreateReply ¶
func PullRequestsCommentsCreateReply(ctx workflow.Context, req PullRequestsCommentsCreateReplyRequest) (*PullComment, error)
PullRequestsCommentsCreateReply is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-reply-for-a-review-comment
func PullRequestsCommentsUpdate ¶ added in v1.11.0
func PullRequestsCommentsUpdate(ctx workflow.Context, thrippyLinkID, owner, repo string, commentID int, body string) (*PullComment, error)
PullRequestsCommentsUpdate is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#update-a-review-comment-for-a-pull-request
type PullRequest ¶
type PullRequest struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
Number int `json:"number"`
State string `json:"state"` // "open" or "closed".
Title string `json:"title"`
Body string `json:"body"`
Draft bool `json:"draft,omitempty"`
Locked bool `json:"locked,omitempty"`
ActiveLockReason string `json:"active_lock_reason,omitempty"` // "off_topic", "too_heated", "resolved", "spam".
Comments int `json:"comments,omitempty"`
ReviewComments int `json:"review_comments,omitempty"`
Commits int `json:"commits,omitempty"`
Additions int `json:"additions,omitempty"`
Deletions int `json:"deletions,omitempty"`
ChangedFiles int `json:"changed_files,omitempty"`
Head Branch `json:"head"`
Base Branch `json:"base"`
User User `json:"user"`
Assignee *User `json:"assignee,omitempty"`
Assignees []User `json:"assignees,omitempty"`
RequestedReviewers []User `json:"requested_reviewers,omitempty"`
RequestedTeams []Team `json:"requested_teams,omitempty"`
AutoMerge *AutoMerge `json:"auto_merge,omitempty"`
Mergeable bool `json:"mergeable,omitempty"`
MergeableState string `json:"mergeable_state,omitempty"` // "clean", "dirty", etc.
Rebaseable bool `json:"rebaseable,omitempty"`
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
ClosedAt time.Time `json:"closed_at,omitzero"`
MergedAt time.Time `json:"merged_at,omitzero"`
Merged bool `json:"merged,omitempty"`
MergedBy *User `json:"merged_by,omitempty"`
MergeCommitSHA string `json:"merge_commit_sha,omitempty"`
}
PullRequest is based on:
- https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28
- https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request
func PullRequestsGet ¶
func PullRequestsGet(ctx workflow.Context, thrippyLinkID, owner, repo string, prID int) (*PullRequest, error)
PullRequestsGet is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request
type PullRequestLinks ¶
type PullRequestLinks struct {
URL string `json:"url"`
HTMLURL string `json:"html_url"`
DiffURL string `json:"diff_url"`
PatchURL string `json:"patch_url"`
MergedAt time.Time `json:"merged_at,omitzero"`
}
PullRequestLinks appears within an Issue when the issue is actually a PullRequest. For example: https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment
type PullRequestsCommentsCreateReplyRequest ¶
type PullRequestsCommentsCreateReplyRequest struct {
PullRequestsRequest
CommentID int `json:"comment_id,omitempty"`
Body string `json:"body"`
}
PullRequestsCommentsCreateReplyRequest is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-reply-for-a-review-comment
type PullRequestsCommentsCreateRequest ¶
type PullRequestsCommentsCreateRequest struct {
PullRequestsRequest
Body string `json:"body"`
CommitID string `json:"commit_id"`
Path string `json:"path"`
InReplyTo int `json:"in_reply_to,omitempty"`
SubjectType string `json:"subject_type,omitempty"` // "line", "file".
StartSide string `json:"start_side,omitempty"` // "LEFT", "RIGHT".
StartLine int `json:"start_line,omitempty"`
Side string `json:"side,omitempty"` // "LEFT", "RIGHT".
Line int `json:"line,omitempty"`
}
PullRequestsCommentsCreateRequest is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#create-a-review-comment-for-a-pull-request
type PullRequestsCommentsDeleteRequest ¶
type PullRequestsCommentsDeleteRequest = PullRequestsCommentsRequest
PullRequestsCommentsDeleteRequest is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#delete-a-review-comment-for-a-pull-request
type PullRequestsCommentsRequest ¶
type PullRequestsCommentsRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Owner string `json:"owner,omitempty"`
Repo string `json:"repo,omitempty"`
CommentID int `json:"comment_id,omitempty"`
}
PullRequestsCommentsRequest contains common fields for PR comment-related requests.
type PullRequestsCommentsUpdateRequest ¶
type PullRequestsCommentsUpdateRequest struct {
PullRequestsCommentsRequest
Body string `json:"body"`
}
PullRequestsCommentsUpdateRequest is based on: https://docs.github.com/en/rest/pulls/comments?apiVersion=2022-11-28#update-a-review-comment-for-a-pull-request
type PullRequestsGetRequest ¶
type PullRequestsGetRequest = PullRequestsRequest
PullRequestsGetRequest is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#get-a-pull-request
type PullRequestsListCommitsRequest ¶
type PullRequestsListCommitsRequest struct {
PullRequestsRequest
// https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api
PerPage int `json:"per_page,omitempty"`
Page int `json:"page,omitempty"`
}
PullRequestsListCommitsRequest is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-commits-on-a-pull-request
type PullRequestsListFilesRequest ¶
type PullRequestsListFilesRequest struct {
PullRequestsRequest
// https://docs.github.com/rest/using-the-rest-api/using-pagination-in-the-rest-api
PerPage int `json:"per_page,omitempty"`
Page int `json:"page,omitempty"`
}
PullRequestsListFilesRequest is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#list-pull-requests-files
type PullRequestsMergeRequest ¶
type PullRequestsMergeRequest struct {
PullRequestsRequest
CommitTitle string `json:"commit_title,omitempty"`
CommitMessage string `json:"commit_message,omitempty"`
SHA string `json:"sha,omitempty"`
MergeMethod string `json:"merge_method,omitempty"` // "merge", "squash", "rebase".
}
PullRequestsMergeRequest is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request
type PullRequestsMergeResponse ¶
type PullRequestsMergeResponse struct {
Merged bool `json:"merged"`
Message string `json:"message"`
SHA string `json:"sha"`
}
PullRequestsMergeResponse is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request
func PullRequestsMerge ¶
func PullRequestsMerge(ctx workflow.Context, req PullRequestsMergeRequest) (*PullRequestsMergeResponse, error)
PullRequestsMerge is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#merge-a-pull-request
type PullRequestsRequest ¶
type PullRequestsRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Owner string `json:"owner,omitempty"`
Repo string `json:"repo,omitempty"`
PullNumber int `json:"pull_number,omitempty"`
}
PullRequestsRequest contains common fields for PR-related requests.
type PullRequestsReviewsCreateRequest ¶
type PullRequestsReviewsCreateRequest struct {
PullRequestsRequest
CommitID string `json:"commit_id,omitempty"`
Body string `json:"body,omitempty"`
Event string `json:"event,omitempty"` // "APPROVE", "REQUEST_CHANGES", "COMMENT", "" = "PENDING".
Comments []map[string]any `json:"comments,omitempty"`
}
PullRequestsReviewsCreateRequest is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request
type PullRequestsReviewsDeleteRequest ¶
type PullRequestsReviewsDeleteRequest = PullRequestsReviewsRequest
PullRequestsReviewsDeleteRequest is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#delete-a-pending-review-for-a-pull-request
type PullRequestsReviewsDismissRequest ¶
type PullRequestsReviewsDismissRequest struct {
PullRequestsReviewsRequest
Message string `json:"message"`
Event string `json:"event,omitempty"` // "DISMISS", "".
}
PullRequestsReviewsDismissRequest is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#dismiss-a-review-for-a-pull-request
type PullRequestsReviewsRequest ¶
type PullRequestsReviewsRequest struct {
ThrippyLinkID string `json:"thrippy_link_id,omitempty"`
Owner string `json:"owner,omitempty"`
Repo string `json:"repo,omitempty"`
PullNumber int `json:"pull_number,omitempty"`
ReviewID int `json:"review_id,omitempty"`
}
PullRequestsReviewsRequest contains common fields for PR review-related requests.
type PullRequestsReviewsSubmitRequest ¶
type PullRequestsReviewsSubmitRequest struct {
PullRequestsReviewsRequest
Body string `json:"body,omitempty"`
Event string `json:"event,omitempty"` // "APPROVE", "REQUEST_CHANGES", "COMMENT".
}
PullRequestsReviewsSubmitRequest is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#submit-a-review-for-a-pull-request
type PullRequestsReviewsUpdateRequest ¶
type PullRequestsReviewsUpdateRequest struct {
PullRequestsReviewsRequest
Body string `json:"body"`
}
PullRequestsReviewsUpdateRequest is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#update-a-review-for-a-pull-request
type PullRequestsUpdateRequest ¶
type PullRequestsUpdateRequest struct {
PullRequestsRequest
Title string `json:"title,omitempty"`
Body string `json:"body,omitempty"`
State string `json:"state,omitempty"` // "open", "closed".
Base string `json:"base,omitempty"`
MaintainerCanModify bool `json:"maintainer_can_modify,omitempty"`
}
PullRequestsUpdateRequest is based on: https://docs.github.com/en/rest/pulls/pulls?apiVersion=2022-11-28#update-a-pull-request
type Reactions ¶
type Reactions struct {
TotalCount int `json:"total_count,omitzero"`
PlusOne int `json:"+1,omitzero"`
MinusOne int `json:"-1,omitzero"`
Laugh int `json:"laugh,omitzero"`
Hooray int `json:"hooray,omitzero"`
Confused int `json:"confused,omitzero"`
Heart int `json:"heart,omitzero"`
Rocket int `json:"rocket,omitzero"`
Eyes int `json:"eyes,omitzero"`
}
Reactions is based on: https://docs.github.com/en/rest/reactions/reactions?apiVersion=2022-11-28
type Repository ¶
type Repository struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
CloneURL string `json:"clone_url,omitempty"`
GitURL string `json:"git_url,omitempty"`
SSHURL string `json:"ssh_url,omitempty"`
Name string `json:"name"`
FullName string `json:"full_name"`
Description *string `json:"description,omitempty"`
Owner *User `json:"owner,omitempty"`
DefaultBranch string `json:"default_branch,omitempty"`
Private bool `json:"private"`
Fork bool `json:"fork"`
PushedAt time.Time `json:"pushed_at,omitzero"`
}
Repository is based on:
type Review ¶
type Review struct {
ID int `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
User User `json:"user"`
State string `json:"state"`
Body string `json:"body"`
CommitID string `json:"commit_id"`
SubmittedAt time.Time `json:"submitted_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
Review is based on:
- https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28
- https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review
func PullRequestsReviewsCreate ¶ added in v1.11.0
func PullRequestsReviewsCreate(ctx workflow.Context, req PullRequestsReviewsCreateRequest) (*Review, error)
PullRequestsReviewsCreate is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#create-a-review-for-a-pull-request
func PullRequestsReviewsDismiss ¶
func PullRequestsReviewsDismiss(ctx workflow.Context, req PullRequestsReviewsDismissRequest) (*Review, error)
PullRequestsReviewsDismiss is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#dismiss-a-review-for-a-pull-request
func PullRequestsReviewsSubmit ¶
func PullRequestsReviewsSubmit(ctx workflow.Context, req PullRequestsReviewsSubmitRequest) (*Review, error)
PullRequestsReviewsSubmit is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#submit-a-review-for-a-pull-request
func PullRequestsReviewsUpdate ¶
func PullRequestsReviewsUpdate(ctx workflow.Context, req PullRequestsReviewsUpdateRequest) (*Review, error)
PullRequestsReviewsUpdate is based on: https://docs.github.com/en/rest/pulls/reviews?apiVersion=2022-11-28#update-a-review-for-a-pull-request
type Team ¶
type Team struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
Slug string `json:"slug"`
Name string `json:"name"`
Description *string `json:"description,omitempty"`
Privacy string `json:"privacy"` // "open", "closed", "secret".
NotificationSetting string `json:"notification_setting"` // "notifications_enabled", "notifications_disabled".
Permission string `json:"permission,omitempty"` // "pull", "triage", "push", "maintain", "admin".
Parent *Team `json:"parent,omitempty"`
}
Team is based on:
type User ¶
type User struct {
ID int64 `json:"id"`
NodeID string `json:"node_id"`
HTMLURL string `json:"html_url"`
AvatarURL string `json:"avatar_url,omitempty"`
Login string `json:"login"`
Type string `json:"type"` // "User", "Bot", "Organization".
Name string `json:"name,omitempty"`
Email string `json:"email,omitempty"`
UserViewType string `json:"user_view_type,omitempty"` // "private", "public".
CreatedAt time.Time `json:"created_at,omitzero"`
UpdatedAt time.Time `json:"updated_at,omitzero"`
}
User is based on: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28
func UsersGetAuthenticated ¶
UsersGetAuthenticated is based on: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-the-authenticated-user
func UsersGetByAccountID ¶
UsersGetByAccountID is based on: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-a-user-using-their-id
func UsersGetByUsername ¶
UsersGetByUsername is based on: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-a-user
type UsersGetRequest ¶
type UsersGetRequest struct {
AccountID string `json:"account_id,omitempty"`
Username string `json:"username,omitempty"`
}
UsersGetRequest is based on: https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28
type UsersListRequest ¶
type UsersListRequest struct {
Since int `json:"since,omitempty"`
PerPage int `json:"per_page,omitempty"`
}
UsersListRequest is based on: