prcomment

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package prcomment upserts sticky pull request comments through the host SCM's GitHub-compatible issue-comment API (GitHub, Forgejo, Gitea). It is a CI helper: nothing on the render, diff, test, get, or diag paths imports it.

Index

Constants

View Source
const (
	// ActionCreated reports that Upsert posted a new comment.
	ActionCreated = "created"
	// ActionUpdated reports that Upsert edited an existing comment.
	ActionUpdated = "updated"
)

Variables

This section is empty.

Functions

func Marker

func Marker(messageID string) string

Marker is the hidden HTML comment that identifies a sticky comment. It is byte-identical to what mshick/add-pr-comment@ec328af writes so comments created by the previous action are updated in place.

Types

type Client

type Client struct {
	BaseURL   string
	Token     string
	HTTP      *http.Client
	UserAgent string
}

Client talks to a GitHub-compatible issue-comment API. The zero HTTP client means http.DefaultClient; Upsert never mutates the client it is given.

func (Client) Upsert

func (c Client) Upsert(ctx context.Context, repository string, number int, messageID, message string) (Result, error)

Upsert posts or updates the sticky comment identified by messageID on the given pull request and reports what it did.

type Result

type Result struct {
	Action string
	ID     int64
	URL    string
}

Result describes what Upsert did with the sticky comment.

Jump to

Keyboard shortcuts

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