feat: edit commit message after merging through PR

Closes #5
This commit is contained in:
Julian Tölle 2024-09-01 14:50:51 +02:00
parent 929d00d696
commit bb0423f509
10 changed files with 402 additions and 26 deletions

View file

@ -39,7 +39,7 @@ func Format(input string) (string, error) {
return buf.String(), nil
}
func GetCodeBlockText(source []byte, language string, output *string) gast.Walker {
func GetCodeBlockText(source []byte, language string, output *string, found *bool) gast.Walker {
return func(n gast.Node, entering bool) (gast.WalkStatus, error) {
if !entering {
return gast.WalkContinue, nil
@ -56,6 +56,9 @@ func GetCodeBlockText(source []byte, language string, output *string) gast.Walke
}
*output = textFromLines(source, codeBlock)
if found != nil {
*found = true
}
// Stop looking after we find the first result
return gast.WalkStop, nil
}