Documentation
¶
Index ¶
- Constants
- Variables
- func AsExitErr(err error) *exec.ExitError
- func CheckPrereleaseLabel(label string, aliases map[string]string) (pre bool, prefix string)
- func GetGithubRepoFromRemote(dir, remote string) (string, error)
- func GetLogger(ctx context.Context) *slog.Logger
- func Ptr[V any](v V) *V
- func ResolveLabel(label string, aliases map[string]string) string
- func RunCmd(dir string, env map[string]string, command string, args ...string) (string, error)
- func WithLogger(ctx context.Context, logger *slog.Logger) context.Context
- type BasePull
- type ChangeLevel
- type CommitComparison
- type GithubClient
- type Pull
- type RepoRelease
Constants ¶
View Source
const ( LabelNone = "semver:none" LabelPatch = "semver:patch" LabelMinor = "semver:minor" LabelBreaking = "semver:breaking" LabelStable = "semver:stable" LabelPrerelease = "semver:prerelease" )
Variables ¶
View Source
var LabelLevels = map[string]ChangeLevel{ LabelBreaking: ChangeLevelMajor, LabelMinor: ChangeLevelMinor, LabelPatch: ChangeLevelPatch, LabelNone: ChangeLevelNone, }
Functions ¶
func CheckPrereleaseLabel ¶
CheckPrereleaseLabel returns true if the label is a prerelease label and the prerelease prefix (the part after the final colon)
func GetGithubRepoFromRemote ¶
Types ¶
type ChangeLevel ¶
type ChangeLevel int
const ( ChangeLevelNone ChangeLevel = iota ChangeLevelPatch ChangeLevelMinor ChangeLevelMajor )
func (ChangeLevel) MarshalJSON ¶
func (l ChangeLevel) MarshalJSON() ([]byte, error)
func (ChangeLevel) String ¶
func (l ChangeLevel) String() string
type CommitComparison ¶
type GithubClient ¶
type GithubClient interface {
ListMergedPullsForCommit(ctx context.Context, owner, repo, sha string) ([]BasePull, error)
CompareCommits(ctx context.Context, owner, repo, base, head string, count int) (*CommitComparison, error)
GenerateReleaseNotes(ctx context.Context, owner, repo, tag, prevTag string) (string, error)
CreateRelease(ctx context.Context, owner, repo, tag, body string, prerelease bool) (*RepoRelease, error)
UploadAsset(ctx context.Context, uploadURL, filename string) error
DeleteRelease(ctx context.Context, owner, repo string, id int64) error
PublishRelease(ctx context.Context, owner, repo string, id int64) error
GetPullRequest(ctx context.Context, owner, repo string, number int) (*BasePull, error)
GetPullRequestCommits(ctx context.Context, owner, repo string, number int) ([]string, error)
}
func NewGithubClient ¶
func NewGithubClient(ctx context.Context, baseUrl, token, userAgent string) (GithubClient, error)
type Pull ¶
type Pull struct {
Number int `json:"number"`
LevelLabels []string `json:"labels,omitempty"`
ChangeLevel ChangeLevel `json:"change_level"`
HasPreLabel bool `json:"has_pre_label,omitempty"`
PreReleasePrefix string `json:"pre_release_prefix,omitempty"`
HasStableLabel bool `json:"has_stable_label,omitempty"`
}
type RepoRelease ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package actions is just a struct to represent a github action.yml file.
|
Package actions is just a struct to represent a github action.yml file. |
|
cmd
|
|
|
Package mock_internal is a generated GoMock package.
|
Package mock_internal is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.