Skip to content

Allow webhook messages to show the full commit message (as opposed to just the summary), if desired. #34285

Closed
@Ratstail91

Description

@Ratstail91

Feature Description

for i, commit := range p.Commits {
// limit the commit message display to just the summary, otherwise it would be hard to read
message := strings.TrimRight(strings.SplitN(commit.Message, "\n", 2)[0], "\r")
// a limit of 50 is set because GitHub does the same
if utf8.RuneCountInString(message) > 50 {
message = fmt.Sprintf("%.47s...", message)
}
text += fmt.Sprintf("[%s](%s) %s - %s", commit.ID[:7], commit.URL, message, commit.Author.Name)
// add linebreak to each commit but the last
if i < len(p.Commits)-1 {
text += "\n"
}
}

My commit messages sometimes have multi-paragraph summaries, and I'd like the full messages to be sent to the discord servers. This option may be configured during webhook creation, or elsewhere, idk.

I've highlighted the discord webhook code, but I'm assuming this could be useful for all the other supported platforms too. I know it's probably not as trivial as it looks, but it'd be an awesome feature, since the repo is private but I like sharing the progress updates to my community.

I'd try doing this myself for a PR, but I don't know Go, and I'm not in a good state to learn it right now. P.S. Thanks for this awesome tool.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions