Documentation
¶
Index ¶
- func Add(root string, paths ...string) error
- func ChangedChangeFilesSinceRef(root, ref string) ([]string, error)
- func Commit(root, message string) error
- func ContributorsSince(root, previousTag string) []string
- func CreateTag(root, tag string) error
- func CurrentBranch(root string) (string, error)
- func CurrentCommit(root string) (string, error)
- func DerivePRNumber(root, filename string) int
- func IdentityConfigured(root string) bool
- func IsAncestor(root, a, b string) bool
- func LatestPrereleaseNumber(root, base, label string) (int, error)
- func LatestStableTag(root, prefix string) (string, error)
- func LatestTagMatching(root string, patterns []*regexp.Regexp) (string, error)
- func Maintainers(root string) map[string]bool
- func MergeRefBaseParent(root string) (string, bool)
- func ResetHard(root, ref string) error
- func ShortSHA(root string) (string, error)
- func TagExists(root, tag string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangedChangeFilesSinceRef ¶
ChangedChangeFilesSinceRef returns basenames of .changes/*.md files added since ref (exclusive) up to HEAD. When ref is empty, the full history is searched. Files matching readme.md or _headline.md are excluded.
func ContributorsSince ¶
ContributorsSince returns the deduplicated commit-author logins (preserving first-seen order, case-insensitive dedup) between previousTag and HEAD via gh api. No filtering: bots and maintainers are included. previousTag must be a real ref (the literal tag, including prefix), not a bare version. Returns nil if gh is unavailable or previousTag is empty.
func CurrentBranch ¶
func CurrentCommit ¶
func DerivePRNumber ¶
DerivePRNumber finds the PR that introduced .changes/<filename> via gh api. Returns 0 if gh is unavailable or the commit has no associated PR.
func IdentityConfigured ¶
IdentityConfigured reports whether a committer identity is resolvable from git config or the standard environment overrides. The CLI never sets one itself (only the workflow does), so a commit on an unconfigured machine would fail after the working tree was already mutated.
func IsAncestor ¶
IsAncestor reports whether a is an ancestor of b (true also when a == b).
func LatestPrereleaseNumber ¶
LatestPrereleaseNumber returns the highest N seen in tags of the form base-label.N or base-label.N+<anything> (semver build metadata).
func LatestStableTag ¶
func LatestTagMatching ¶
LatestTagMatching returns the name of the most recently created tag that matches any of the provided patterns. Returns "" when no tag matches.
func Maintainers ¶
Maintainers returns the set of repo collaborator logins (lowercased) that have admin or maintain permission, used to exclude them from the contributors footer. Returns nil if gh is unavailable (e.g. the token lacks push access), in which case no maintainer filtering is applied.
func MergeRefBaseParent ¶
MergeRefBaseParent returns HEAD's first parent and true when HEAD is a merge commit (two or more parents). A GitHub pull_request checkout uses the synthetic refs/pull/N/merge ref, whose first parent is the base branch tip the PR is being merged into — a more reliable base than the event's recorded base.sha, which can lag on long-lived or reopened PRs. Returns ("", false) otherwise.
Types ¶
This section is empty.