publish

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 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

Overview

Package publish posts the GitHub plugin's approved drafts as issue comments on their pull request.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Publisher

type Publisher struct {
	GH     REST
	Viewer func(ctx context.Context) (string, error)
	// People are the persons the unit's items name, for mentions of other
	// providers.
	People func(ctx context.Context, u sdk.Unit) ([]src.Person, error)
	// Record keeps an event on the host.
	Record func(ctx context.Context, ev src.Event) error
	Now    func() time.Time
	Log    func(format string, args ...any)
}

Publisher posts GitHub drafts as issue comments on their pull request.

func (*Publisher) Place

func (p *Publisher) Place(context.Context, src.Draft) (src.Placed, error)

Place keeps a draft on its own pull request.

func (*Publisher) Publish

func (p *Publisher) Publish(ctx context.Context, d src.Draft) (src.Evidence, error)

Publish posts d as a comment. A nudge then records its nudged event, as the nudge intent does, so the comment reads as a nudge; a refused post records none.

func (*Publisher) Validate

func (p *Publisher) Validate(ctx context.Context, d src.Draft) error

Validate refuses a draft GitHub cannot take as a comment on the draft's own pull request.

func (*Publisher) Verify

func (p *Publisher) Verify(ctx context.Context, d src.Draft, startedAt time.Time) (src.Evidence, bool, error)

Verify looks for the viewer's comment with d's body among those since startedAt.

func (*Publisher) Where

func (p *Publisher) Where(ctx context.Context, d src.Draft) (string, error)

Where names the pull request d comments on.

type REST

type REST interface {
	REST(ctx context.Context, r api.Request) (api.Response, error)
}

REST is GitHub's REST API.

Jump to

Keyboard shortcuts

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