Documentation
¶
Overview ¶
Package announce implements the `announce` verb: tell people a release happened, through the adapters .colophon.yaml configures.
Index ¶
- Variables
- func CheckFailureExit(code int) error
- func NewCmdAnnounce(props *props.Props) *setup.Command
- func OperatorAnnounce(p *props.Props) ([]manifest.Announce, error)
- func Run(ctx context.Context, p *props.Props, opts *AnnounceOptions, w io.Writer) error
- func RunAnnounce(ctx context.Context, p *props.Props, opts *AnnounceOptions, _ []string) error
- func Withheld(w io.Writer, tags []string) error
- type AnnounceOptions
- type Created
Constants ¶
This section is empty.
Variables ¶
var DefaultAuthor = object.Signature{Name: "colophon", Email: "colophon@phpboyscout.uk"}
DefaultAuthor is attributed to a commit an adapter makes when the verb running it has no author flags of its own (`release`).
var ErrAnnouncementFailed = errors.New("announce")
ErrAnnouncementFailed reports a run whose release stood and whose announcing did not all go out, when --announce-failure-exit asked to hear about it (spec 0028).
var ErrBadFailureExit = errorhandling.WithOutcome( errFailureExitRange, errorhandling.Outcome{Code: errorhandling.ExitCodeUsage, Level: slog.LevelWarn, Usage: true}, )
ErrBadFailureExit reports an --announce-failure-exit a caller could not tell apart from colophon's own failures, or the shell's.
var ErrNoRelease = errors.New("announce: no release to announce")
ErrNoRelease reports a tag carrying no release object. Announcing one that does not exist would put out a link to nothing.
var ErrTagRequired = errors.New("announce: --tag names the release to announce")
ErrTagRequired reports a run with no release named.
var ErrUnknownAdapter = errors.New("announce: no such adapter")
ErrUnknownAdapter reports an adapter the manifest names and colophon does not have.
Functions ¶
func CheckFailureExit ¶ added in v0.17.0
CheckFailureExit refuses a code that already means something else. Zero is unset.
func OperatorAnnounce ¶ added in v0.13.0
OperatorAnnounce reads the operator's announce block from the configuration layer: settings an adapter inherits when the manifest names it with nothing of its own (spec 0026 D2). No configuration is no block.
func RunAnnounce ¶
RunAnnounce is the `announce` verb.
Types ¶
type AnnounceOptions ¶
type Created ¶ added in v0.13.0
type Created struct {
Root string
Settings manifest.Manifest
Origin remote.Remote
Reader release.Reader
Provider forge.Provider
Author object.Signature
// Adapters, when set, stands in for what the manifest configures.
Adapters []libannounce.Configured
// FailureExit is --announce-failure-exit; zero keeps exit 0.
FailureExit int
}
Created announces the releases a run just created, for publish and release (spec 0026 D1). Nothing is printed when the manifest names no adapter: a project that did not opt in sees no change to its report.