github

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Signals = []string{
	"github.events.pull_request",
	"github.events.pull_request_review",
	"github.events.pull_request_review_comment",
	"github.events.pull_request_review_thread",

	"github.events.issue_comment",
}

Signals is a list of signal names that RevChat receives from Timpani, to trigger event handling workflows.

This is based on:

Functions

func RegisterSignals added in v0.3.0

func RegisterSignals(ctx workflow.Context, sel workflow.Selector, taskQueue string)

RegisterSignals routes Signals to registered workflows.

func RegisterWorkflows

func RegisterWorkflows(w worker.Worker, cmd *cli.Command)

RegisterWorkflows maps event handler functions to Signals.

Types

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"`
}

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"`
}

type ChangeBase added in v0.2.0

type ChangeBase struct {
	Ref ChangeFrom `json:"ref"`
	SHA ChangeFrom `json:"sha"`
}

type ChangeFrom added in v0.2.0

type ChangeFrom struct {
	From string `json:"from"`
}

type Changes

type Changes struct {
	Base  *ChangeBase `json:"base,omitempty"`
	Body  *ChangeFrom `json:"body,omitempty"`
	Title *ChangeFrom `json:"title,omitempty"`
}

type Comment

type Comment struct{}

type Config added in v0.3.0

type Config struct {
	Cmd *cli.Command
}

type Installation

type Installation struct {
	ID int64 `json:"id"`
}

type Issue

type Issue struct{}

type IssueCommentEvent

type IssueCommentEvent struct {
	Action string `json:"action"`
	Issue  Issue  `json:"issue"`
	Sender User   `json:"sender"`

	Comment Comment  `json:"comment"`
	Changes *Changes `json:"changes,omitempty"`
}

https://docs.github.com/en/webhooks/webhook-events-and-payloads#issue_comment

type Organization

type Organization struct {
	ID    int64  `json:"id"`
	Login string `json:"login"`
}

type PullRequest

type PullRequest struct {
	ID     int64 `json:"id"`
	Number int   `json:"number"`

	HTMLURL  string  `json:"html_url"`
	DiffURL  string  `json:"diff_url"`
	PatchURL string  `json:"patch_url"`
	Title    string  `json:"title"`
	Body     *string `json:"body"`
	State    string  `json:"state"`

	AuthorAssociation  string `json:"author_association"`
	User               User   `json:"user"`
	Assignee           *User  `json:"assignee"`
	Assignees          []User `json:"assignees"`
	RequestedReviewers []User `json:"requested_reviewers"`
	RequestedTeams     []Team `json:"requested_teams"`

	CreatedAt      string     `json:"created_at"`
	UpdatedAt      string     `json:"updated_at"`
	ClosedAt       *string    `json:"closed_at"`
	MergedAt       *string    `json:"merged_at"`
	MergedBy       *User      `json:"merged_by"`
	MergeCommitSHA *string    `json:"merge_commit_sha"`
	AutoMerge      *AutoMerge `json:"auto_merge"`

	// Labels    []Label    `json:"labels"`
	// Milestone *Milestone `json:"milestone"`
	Head Branch `json:"head"`
	Base Branch `json:"base"`

	ActiveLockReason *string `json:"active_lock_reason"`
	Draft            bool    `json:"draft"`
	Locked           bool    `json:"locked"`
	Merged           bool    `json:"merged"`
	Mergeable        *bool   `json:"mergeable"`
	Rebaseable       *bool   `json:"rebaseable"`
	MergeableState   string  `json:"mergeable_state"`
	Comments         int     `json:"comments"`
	ReviewComments   int     `json:"review_comments"`
	Commits          int     `json:"commits"`
	Additions        int     `json:"additions"`
	Deletions        int     `json:"deletions"`
	ChangedFiles     int     `json:"changed_files"`
}

type PullRequestEvent

type PullRequestEvent struct {
	Action      string      `json:"action"`
	Number      int         `json:"number"`
	PullRequest PullRequest `json:"pull_request"`
	Sender      User        `json:"sender"`

	Assignee          *User `json:"assignee,omitempty"`
	RequestedReviewer *User `json:"requested_reviewer,omitempty"`
	RequestedTeam     *Team `json:"requested_team,omitempty"`

	Changes *Changes `json:"changes,omitempty"`
	Before  *string  `json:"before,omitempty"`
	After   *string  `json:"after,omitempty"`
}

https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request

type PullRequestReviewCommentEvent

type PullRequestReviewCommentEvent struct {
	Action      string      `json:"action"`
	PullRequest PullRequest `json:"pull_request"`
	Sender      User        `json:"sender"`

	Comment Comment  `json:"comment"`
	Changes *Changes `json:"changes,omitempty"`
}

https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review_comment

type PullRequestReviewEvent

type PullRequestReviewEvent struct {
	Action      string      `json:"action"`
	PullRequest PullRequest `json:"pull_request"`
	Sender      User        `json:"sender"`

	Review  Review   `json:"review"`
	Changes *Changes `json:"changes,omitempty"`
}

https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review

type PullRequestReviewThreadEvent

type PullRequestReviewThreadEvent struct {
	Action      string      `json:"action"`
	PullRequest PullRequest `json:"pull_request"`
	Sender      User        `json:"sender"`

	Thread Thread `json:"thread"`
}

https://docs.github.com/en/webhooks/webhook-events-and-payloads#pull_request_review_thread

type Repository

type Repository struct {
	ID       int64  `json:"id"`
	Name     string `json:"name"`
	FullName string `json:"full_name"`
	HTMLURL  string `json:"html_url"`
	Owner    User   `json:"owner"`
}

type Review

type Review struct{}

type Team

type Team struct {
	ID          int64   `json:"id"`
	Slug        string  `json:"slug"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	HTMLURL     string  `json:"html_url"`
}

type Thread

type Thread struct{}

type User

type User struct {
	ID        int64  `json:"id"`
	Login     string `json:"login"`
	HTMLURL   string `json:"html_url"`
	Type      string `json:"type"`
	SiteAdmin bool   `json:"site_admin"`
}

Jump to

Keyboard shortcuts

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