forgejo/services/webhook
Valentine Briese 51ac1bf45f feat: improve Discord webhook message formatting (#10626)
This pull request escapes the dash before the author when a Discord webhook is triggered by a push event and formats the commit hash as code.

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

No tests were added, but the existing test for Discord webhooks passed.

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/10626
Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
Co-authored-by: Valentine Briese <valentinegb@icloud.com>
Co-committed-by: Valentine Briese <valentinegb@icloud.com>
2025-12-30 18:01:17 +01:00
..
shared Actions Failure, Succes, Recover Webhooks (#7508) 2025-06-03 14:29:19 +02:00
sourcehut chore: remove branding from context imports (#9628) 2025-10-11 01:52:51 +02:00
TestPushCommits feat: add commit limit for webhook payload (#6797) 2025-02-07 19:26:50 +00:00
default.go feat(ui): redesign migration selection screen (#6795) 2025-04-19 13:51:35 +00:00
default_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
deliver.go chore(cleanup): replaces unnecessary calls to formatting functions by non-formatting equivalents (#7994) 2025-05-29 17:34:29 +02:00
deliver_test.go feat: use keying for webhook secrets (#10059) 2025-12-22 15:51:37 +01:00
dingtalk.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
dingtalk_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
discord.go feat: improve Discord webhook message formatting (#10626) 2025-12-30 18:01:17 +01:00
discord_test.go feat: improve Discord webhook message formatting (#10626) 2025-12-30 18:01:17 +01:00
feishu.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
feishu_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
general.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
general_test.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
gogs.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
main_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
matrix.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
matrix_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
msteams.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
msteams_test.go Update module github.com/golangci/golangci-lint/cmd/golangci-lint to v2 (forgejo) (#7367) 2025-03-28 22:22:21 +00:00
notifier.go feat: make upload URL compatible with GitHub API (#9285) 2025-09-15 15:53:35 +02:00
notifier_test.go Actions Failure, Succes, Recover Webhooks (#7508) 2025-06-03 14:29:19 +02:00
packagist.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packagist_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
slack.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
slack_test.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
telegram.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00
telegram_test.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
webhook.go fix: paginate GET /api/v1/admin/hooks response (#9915) 2025-11-06 00:08:13 +01:00
webhook_test.go chore: QoL improvements to tests (#7917) 2025-05-21 15:45:56 +02:00
wechatwork.go feat: place user names into inline code blocks for Slack (#10147) 2025-11-25 23:24:05 +01:00