helpers

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureMessage

func ConfigureMessage(msg entities.Message) (s string, err error)

ConfigureMessage configures the message for the comment

If the message is a merge commit, returns an error, because merge commits are handled by the different webhook. Done to avoid duplicate comments on push and merge hooks.

func Find

func Find[T any](content []*T, predicate func(*T) bool) *T

func GetBranchNameFromRef

func GetBranchNameFromRef(ref string) string

GetBranchNameFromRef returns the branch name from the ref

Example: refs/heads/feature-123 -> feature-123

func ParseTaskMentions

func ParseTaskMentions(txt string) []*entities.TaskMention

ParseTaskMentions parses all the task mentions in a text

func RemoveDuplicates

func RemoveDuplicates[T comparable](content []*T) []*T

Types

type MessageParser added in v0.1.0

type MessageParser struct {
	// contains filtered or unexported fields
}

func NewMessageParser added in v0.1.0

func NewMessageParser(ff *config.FeatureFlags) *MessageParser

func (*MessageParser) GetTaskMentions added in v0.1.0

func (p *MessageParser) GetTaskMentions(msg entities.Message) (string, []*entities.TaskMention, error)

GetTaskMentions returns the configured message and all the tasks mentioned in the commit message and the branch name, if the commit mentions are enabled.

Jump to

Keyboard shortcuts

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