Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Ratstail91 opened this issue Apr 25, 2025 · 2 comments
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.

Comments

@Ratstail91
Copy link

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

@Ratstail91 Ratstail91 added the type/proposal The new feature has not been accepted yet but needs to be discussed first. label Apr 25, 2025
@lunny
Copy link
Member

lunny commented Apr 25, 2025

Related to #31970 and it's a bug report from #31668

@Ratstail91
Copy link
Author

My apologies, it seems this is partially related to #34124 - these limits exist due Discord's own restrictions, and gitea can't really work around them. I've been digging into the code and docker stuff to see how hard building my own fork would be, but I stumbled across that issue, and... yeah, I get it.

In the future, I'll try not to post feature requests while falling asleep 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/proposal The new feature has not been accepted yet but needs to be discussed first.
Projects
None yet
Development

No branches or pull requests

2 participants