lib

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2024 License: Apache-2.0 Imports: 26 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyRepoModified

func AnyRepoModified(wd string, sh *shell.Session) bool

func AppendIf added in v0.0.34

func AppendIf(slice []string, cond bool, elems ...string) []string

func ClosePR added in v0.0.11

func ClosePR(gh *github.Client, owner string, repo string, head, base string) (*github.PullRequest, error)

func CommitAnyRepo

func CommitAnyRepo(wd string, sh *shell.Session, tag string, messages ...string) error

func CommitRepo

func CommitRepo(sh *shell.Session, tag string, messages ...string) error

func ConfigureGit added in v0.0.12

func ConfigureGit(sh *shell.Session, key, value string, global bool) error

func CreatePR

func CreatePR(gh *github.Client, owner string, repo string, req *github.NewPullRequest, labels ...string) (*github.PullRequest, error)

func DetectVCSRoot

func DetectVCSRoot(repoURL string) (string, error)

func Execute added in v0.0.2

func Execute(sh *shell.Session, cmd string, env map[string]string) error

func Exists

func Exists(name string) bool

Exists reports whether the named file or directory Exists.

func FirstCommit

func FirstCommit(sh *shell.Session) string

func GetQueryParameter added in v0.0.11

func GetQueryParameter(v url.Values, key string) sets.Set[string]

func GetRemoteTag

func GetRemoteTag(sh *shell.Session, tag string) string

func HasKey added in v0.0.18

func HasKey(m map[string]string, key string) bool

func IsGitConfigured added in v0.0.12

func IsGitConfigured(sh *shell.Session, key string, global bool) bool

func IsPublicGitRepo added in v0.0.26

func IsPublicGitRepo(repoURL string) bool

func IsTagged added in v0.0.28

func IsTagged(sh *shell.Session) (string, bool)

IsTagged checks if the current commit is tagged.

func Key2EnvKey added in v0.0.31

func Key2EnvKey(key string) string

func Keys

func Keys(m map[string]string) []string

func LabelPR

func LabelPR(gh *github.Client, owner string, repo, head, base string, labels ...string) error

func LastCommitBody added in v0.0.2

func LastCommitBody(sh *shell.Session, trimBlankLines bool) string

func LastCommitSHA added in v0.0.2

func LastCommitSHA(sh *shell.Session) string

func LastCommitSubject added in v0.0.2

func LastCommitSubject(sh *shell.Session) string

func ListComments

func ListComments(ctx context.Context, gh *github.Client, owner, repo string, number int) ([]*github.IssueComment, error)

func ListCommits

func ListCommits(sh *shell.Session, start, end string) []api.Commit

func ListLabelsByIssue added in v0.0.9

func ListLabelsByIssue(ctx context.Context, gh *github.Client, owner, repo string, number int) (sets.Set[string], error)

func ListPullRequestComment

func ListPullRequestComment(ctx context.Context, gh *github.Client, owner, repo string, number int) ([]*github.PullRequestComment, error)

func ListReleases added in v0.0.36

func ListReleases(ctx context.Context, gh *github.Client, owner, repo string) ([]*github.RepositoryRelease, error)

func ListReviews

func ListReviews(ctx context.Context, gh *github.Client, owner, repo string, number int) ([]*github.PullRequestReview, error)

func ListTags

func ListTags(sh *shell.Session) ([]string, error)

func ListTags2

func ListTags2(ctx context.Context, gh *github.Client, owner, repo string) ([]*github.RepositoryTag, error)

func LoadChangelog added in v0.0.2

func LoadChangelog(dir string, release api.Release) api.Changelog

func MarshalJson

func MarshalJson(v interface{}) ([]byte, error)

func MeetsCondition

func MeetsCondition(fn ConditionFunc, sh *shell.Session, items ...string) bool

func MergeMaps

func MergeMaps(dst, src map[string]string) map[string]string

func NewGitHubClient

func NewGitHubClient() *github.Client

func ParseComment

func ParseComment(s string) []api.Reply

func ParsePullRequestURL

func ParsePullRequestURL(prURL string) (string, string, int)

func ParseReply

func ParseReply(s string) *api.Reply

func ParseRepoURL

func ParseRepoURL(repoURL string) (string, string)

func PushAnyRepo

func PushAnyRepo(wd string, sh *shell.Session, pushTag bool) error

func PushRepo

func PushRepo(sh *shell.Session, pushTag bool) error

func RemoteBranchExists

func RemoteBranchExists(sh *shell.Session, branch string) bool

func RemoteTagExists

func RemoteTagExists(sh *shell.Session, tag string) bool

func RemoveLabel added in v0.0.3

func RemoveLabel(gh *github.Client, owner string, repo string, number int, label string) error

func RepoModified

func RepoModified(sh *shell.Session) bool

func RepoURL2EnvKey added in v0.0.31

func RepoURL2EnvKey(repoURL string) string

func ResetRepo

func ResetRepo(sh *shell.Session) error

func TagRepo

func TagRepo(sh *shell.Session, tag string, messages ...string) error

func UniqComments

func UniqComments(comments []string) []string

func UpdateChangelog

func UpdateChangelog(dir string, release api.Release, repoURL, tag string, commits []api.Commit)

func Values

func Values(m map[string]string) []string

func WriteChangelogMarkdown

func WriteChangelogMarkdown(filename string, tplname string, data interface{})

Types

type ConditionFunc

type ConditionFunc func(*shell.Session, string) bool

type GoImport

type GoImport struct {
	RepoRoot string
	VCSRoot  string
}

func (GoImport) String

func (g GoImport) String() string

type MetaData

type MetaData struct {
	GoImport string `meta:"go-import"`
}

type Pair added in v0.0.6

type Pair struct {
	Key   string
	Value string
}

func ToOrderedPair added in v0.0.6

func ToOrderedPair(in map[string]string) []Pair

Jump to

Keyboard shortcuts

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