pr

package
v0.10.8 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindTerraCIComment

func FindTerraCIComment(comments []*gh.IssueComment) *gh.IssueComment

func GetPRNumberFromEvent

func GetPRNumberFromEvent() int

func ParseRepository

func ParseRepository(repository string) (owner, repo string)

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(token, repository string) *Client

func NewClientFromEnv

func NewClientFromEnv() *Client

func (*Client) AddIssueLabels added in v0.10.5

func (c *Client) AddIssueLabels(ctx context.Context, prNumber int, labels []string) error

func (*Client) CreateIssueComment

func (c *Client) CreateIssueComment(ctx context.Context, prNumber int, body string) (*gh.IssueComment, error)

func (*Client) HasToken

func (c *Client) HasToken() bool

func (*Client) ListIssueComments

func (c *Client) ListIssueComments(ctx context.Context, prNumber int) ([]*gh.IssueComment, error)

func (*Client) RemoveIssueLabel added in v0.10.5

func (c *Client) RemoveIssueLabel(ctx context.Context, prNumber int, label string) error

func (*Client) UpdateIssueComment

func (c *Client) UpdateIssueComment(ctx context.Context, commentID int64, body string) (*gh.IssueComment, error)

type Context

type Context struct {
	Owner        string
	Repo         string
	PRNumber     int
	SourceBranch string
	TargetBranch string
	RunID        string
	CommitSHA    string
	InPR         bool
}

func DetectContext

func DetectContext() *Context

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(client issueCommentClient, ctx *Context) *Service

func NewServiceFromEnv

func NewServiceFromEnv() *Service

func (*Service) CurrentCommentBody added in v0.10.5

func (s *Service) CurrentCommentBody(ctx context.Context) (body string, found bool, err error)

CurrentCommentBody returns the current TerraCI PR comment body, if present.

func (*Service) IsEnabled

func (s *Service) IsEnabled() bool

func (*Service) SyncLabels added in v0.10.5

func (s *Service) SyncLabels(ctx context.Context, previous, current []string) error

SyncLabels synchronizes TerraCI-managed PR labels.

func (*Service) UpsertComment

func (s *Service) UpsertComment(ctx context.Context, body string) error

Jump to

Keyboard shortcuts

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