Documentation
¶
Overview ¶
Package forge abstracts the "publish a release" operation against a code hosting provider. The default implementation (GitHubReleaser) targets the GitHub REST API; the interface keeps the runner provider-agnostic.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrForge = errors.New("forge error")
ErrForge is the sentinel returned (wrapped) when a release-hosting operation fails. Callers should use errors.Is to branch on it.
Functions ¶
This section is empty.
Types ¶
type CreateReleaseOptions ¶
type CreateReleaseOptions struct {
Owner string
Repo string
TagName string // e.g. "v1.2.3" or "module/v1.2.3"
Name string // human-readable release title
Body string // release notes (markdown)
}
CreateReleaseOptions describes a single release publication.
type GitHubReleaser ¶
type GitHubReleaser struct {
// contains filtered or unexported fields
}
GitHubReleaser publishes releases against the public GitHub API.
func NewGitHubReleaser ¶
func NewGitHubReleaser(token string) *GitHubReleaser
NewGitHubReleaser returns a Releaser configured with the supplied bearer token (typically a GitHub App installation token).
func NewGitHubReleaserFromClient ¶
func NewGitHubReleaserFromClient(client *github.Client) *GitHubReleaser
NewGitHubReleaserFromClient is a test-friendly constructor that accepts a pre-configured *github.Client. Production code should prefer NewGitHubReleaser; tests can swap in a client pointed at httptest.
func (*GitHubReleaser) CreateRelease ¶
func (g *GitHubReleaser) CreateRelease(ctx context.Context, opts CreateReleaseOptions) error
CreateRelease creates a GitHub Release.