util

package
v0.18.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCommitMessage added in v0.3.0

func BuildCommitMessage() (message string)

BuildCommitMessage generates a commit message from the message and trailers configuration

func BuildTrailers added in v0.9.1

func BuildTrailers() (trailers []string)

BuildTrailers generates the complete list of trailers from the configuration

func GetCliAuthToken added in v0.13.0

func GetCliAuthToken() string

GetCliAuthToken tries to get a GitHub token by execing `gh auth token`

func GithubActionsBranch added in v0.9.1

func GithubActionsBranch() (branch string)

GithubActionsBranch returns the branch name if running in a GitHub Actions environment, or an empty string

func IsBinaryInPath added in v0.13.0

func IsBinaryInPath(name string) bool

IsBinaryInPath checks if a given binary is available in the PATH

func IsCommitHash added in v0.9.1

func IsCommitHash(ref string) bool

IsCommitHash returns true if the ref looks like a commit hash

func IsValidRefName added in v0.9.1

func IsValidRefName(refName string) error

IsValidRefName checks if the ref name matches git ref requirements

func MapValues added in v0.13.0

func MapValues[T any](m map[string]T) []T

func PrettyJson added in v0.13.0

func PrettyJson(r any) string

func QualifiedRefName added in v0.13.0

func QualifiedRefName(refName string, refType string) (string, error)

QualifiedRefName normalizes the ref name to a fully qualified format

func ShortJson added in v0.13.0

func ShortJson(r any) string

func SliceChain added in v0.13.0

func SliceChain[T any](slices ...[]T) iter.Seq[T]

Types

type RepositoryContext added in v0.9.1

type RepositoryContext struct {
	Owner  string
	Name   string
	Branch string
}

func GithubActionsContext added in v0.9.1

func GithubActionsContext() *RepositoryContext

GithubActionsContext returns repository context if running in a GitHub Actions environment

Jump to

Keyboard shortcuts

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