gitea/services
Sumit f09bea7af1
[Fix] Trigger 'unlabeled' event when label is Deleted from PR (#34316)
This pull request updates the handling of issue label events in
workflows to distinguish between label additions and deletions,
introduces corresponding test cases, and extends the `IssuePayload`
structure to support this functionality.

### Enhancements to issue label event handling:
* Updated `matchIssuesEvent` in `modules/actions/workflows.go` to
differentiate between "labeled" and "unlabeled" events based on whether
labels were added or removed.
* Added a new field, `RemovedLabels`, to the `IssuePayload` struct in
`modules/structs/hook.go` to track labels that were removed during an
issue event.

### Testing improvements:
* Added `TestMatchIssuesEvent` in `modules/actions/workflows_test.go` to
cover scenarios such as label addition, label deletion, and label
clearing, ensuring the correct event type is triggered.

---------

Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
2025-09-24 09:45:38 +07: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 +07:00
auth Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +07:00
automerge Rename pull request GetGitRefName to GetGitHeadRefName (#35093) 2025-07-16 21:33:33 +07:00
automergequeue Rename pull request GetGitRefName to GetGitHeadRefName (#35093) 2025-07-16 21:33:33 +07:00
context Fix various typos in codebase (#35480) 2025-09-13 10:34:43 +07:00
contexttest Fix session gob (#35128) 2025-07-20 01:49:36 +07:00
convert Exposing TimeEstimate field in the API (#35475) 2025-09-16 04:32:03 +07:00
cron Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 +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 +07:00
feed Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +07:00
forms Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +07:00
git Fix git commit committer parsing and add some tests (#35007) 2025-07-10 19:03:36 +07:00
gitdiff Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 +07: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 +07: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 +07: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 +07:00
oauth2_provider Fix context usages (#35348) 2025-08-27 11:00:01 +07:00
org Use db.WithTx/WithTx2 instead of TxContext when possible (#35428) 2025-09-10 03:15:01 +07:00
packages Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +07:00
projects Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +07:00
pull Move updateref and removeref to gitrepo and remove unnecessary open repository (#35511) 2025-09-19 08:04:18 +07:00
release Move git command to git/gitcmd (#35483) 2025-09-15 23:33:12 +07:00
repository Stream repo zip/tar.gz/bundle achives by default (#35487) 2025-09-19 11:51:21 +07:00
secrets Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +07:00
task Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +07:00
uinotification Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +07:00
user Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +07:00
versioned_migration Remove wrong "git.DefaultContext" (#35364) 2025-08-27 16:31:21 +07:00
webhook Replace gobwas/glob package (#35478) 2025-09-13 18:01:00 +07:00
webtheme Run `gopls modernize` on codebase (#34751) 2025-06-18 01:48:09 +07:00
wiki Move some functions from package git to gitrepo (#33910) 2025-09-01 19:13:18 +07:00