gitea/services/webhook
Kausthubh J Rao c4532101a4
fix(webhook): prevent tag events from bypassing branch filters targets #35449 (#35567)
Tag creation/deletion was triggering push webhooks even when branch
filters were configured, causing unintended pipeline executions.

This change modifies the branch filter logic to check the full ref
name directly instead of first determining if it's a "branch" event.

Fixes: Tag events now properly respect branch filters
- Add getPayloadRef() function to extract full ref names
- Update PrepareWebhook() to use direct ref matching
- Prevents refs/tags/* from matching refs/heads/* filters

Closes #35449

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
2025-10-03 08:51:57 +07:00
..
deliver.go Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +07:00
deliver_test.go use experimental go json v2 library (#35392) 2025-09-28 08:03:36 +07:00
dingtalk.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
dingtalk_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +07:00
discord.go fix(webhook/discord): fixed username cannot be empty error (#35412) 2025-09-05 11:19:31 +07:00
discord_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +07:00
feishu.go Fix Feishu webhook signature verification (#34788) 2025-06-20 13:09:03 +07:00
feishu_test.go Fix Feishu webhook signature verification (#34788) 2025-06-20 13:09:03 +07:00
general.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
general_test.go
main_test.go
matrix.go use experimental go json v2 library (#35392) 2025-09-28 08:03:36 +07:00
matrix_test.go use experimental go json v2 library (#35392) 2025-09-28 08:03:36 +07:00
msteams.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
msteams_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 +07:00
notifier.go Reload issue when sending webhook to make num comments is right. (#35243) 2025-08-11 11:27:22 +07:00
packagist.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
packagist_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 +07:00
payloader.go Fix Feishu webhook signature verification (#34788) 2025-06-20 13:09:03 +07:00
slack.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00
slack_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +07:00
telegram.go Refactor wiki (#34805) 2025-06-22 18:53:33 +07:00
telegram_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +07:00
webhook.go fix(webhook): prevent tag events from bypassing branch filters targets #35449 (#35567) 2025-10-03 08:51:57 +07:00
webhook_test.go fix(webhook): prevent tag events from bypassing branch filters targets #35449 (#35567) 2025-10-03 08:51:57 +07:00
wechatwork.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +07:00