gitea/services
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 +02:00
..
actions [Fix] Trigger 'unlabeled' event when label is Deleted from PR (#34316) 2025-09-24 09:45:38 -07:00
agit Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 -07:00
asymkey Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 -07:00
attachment Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
auth Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
automerge Rename pull request GetGitRefName to GetGitHeadRefName (#35093) 2025-07-16 21:33:33 +08:00
automergequeue Rename pull request GetGitRefName to GetGitHeadRefName (#35093) 2025-07-16 21:33:33 +08:00
context Fix various typos in codebase (#35480) 2025-09-13 10:34:43 -04:00
contexttest Fix session gob (#35128) 2025-07-20 01:49:36 +00:00
convert Move some functions to gitrepo package (#35503) 2025-09-26 10:14:20 -07:00
cron Use global lock instead of status pool for cron lock (#35507) 2025-09-27 10:11:52 -07:00
doctor Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 -07:00
externalaccount Refactor OpenIDConnect to support SSH/FullName sync (#34978) 2025-07-10 18:35:59 +00:00
feed Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
forms Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +00:00
git Fix git commit committer parsing and add some tests (#35007) 2025-07-10 19:03:36 +00:00
gitdiff Added button to copy file name in PR files (#35509) 2025-10-02 18:08:11 +00:00
indexer
issue Move updateref and removeref to gitrepo and remove unnecessary open repository (#35511) 2025-09-19 08:04:18 -07:00
lfs Fix LFS range size header response (#35277) 2025-08-16 16:51:45 +00:00
mailer Refactor and update mail templates (#35150) 2025-09-04 20:20:42 -07:00
markup Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
migrations Move updateref and removeref to gitrepo and remove unnecessary open repository (#35511) 2025-09-19 08:04:18 -07:00
mirror Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 -07:00
notify Don't send trigger for a pending review's comment create/update/delete (#34928) 2025-07-03 10:35:45 +08:00
oauth2_provider Fix context usages (#35348) 2025-08-27 11:00:01 +00:00
org Use db.WithTx/WithTx2 instead of TxContext when possible (#35428) 2025-09-10 03:15:01 +00:00
packages Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
projects Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
pull Move some functions to gitrepo package (#35503) 2025-09-26 10:14:20 -07:00
release Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 -07:00
repository Move some functions to gitrepo package (#35503) 2025-09-26 10:14:20 -07:00
secrets Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
task Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
uinotification Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
user Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +00:00
versioned_migration Remove wrong "git.DefaultContext" (#35364) 2025-08-27 16:31:21 +00:00
webhook fix(webhook): prevent tag events from bypassing branch filters targets #35449 (#35567) 2025-10-03 08:51:57 +02:00
webtheme Run gopls modernize on codebase (#34751) 2025-06-18 01:48:09 +00:00
wiki Move some functions to gitrepo package (#35503) 2025-09-26 10:14:20 -07:00