gitea/services/actions
Sumit f09bea7af1
Some checks failed
release-nightly / nightly-docker-rootless (push) Has been cancelled
release-nightly / nightly-binary (push) Has been cancelled
release-nightly / nightly-docker-rootful (push) Has been cancelled
[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
..
auth_test.go Enable testifylint rules (#34075) 2025-03-31 01:53:48 -04:00
auth.go Fix token lifetime, closes #35230 (#35271) 2025-08-14 06:57:05 +00:00
cleanup.go Fix ephemeral runner deletion (#34447) 2025-05-20 15:42:31 +00:00
clear_tasks.go Prevent duplicate actions email (#35215) 2025-08-24 09:30:56 -07:00
commit_status.go Keeping consistent between UI and API about combined commit status state and fix some bugs (#34562) 2025-06-09 04:05:33 +00:00
context_test.go Use test context in tests and new loop system in benchmarks (#33648) 2025-02-20 09:57:40 +00:00
context.go Fix possible panic (#34508) 2025-05-22 12:59:42 +00:00
init_test.go Remove incorrect "db.DefaultContext" usages (#35366) 2025-08-28 03:52:43 +00:00
init.go Use env GITEA_RUNNER_REGISTRATION_TOKEN as global runner token (#32946) 2024-12-23 09:59:16 +00:00
interface.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
job_emitter_test.go Improve the handling of jobs.<job_id>.if (#31070) 2024-05-27 14:15:34 +08:00
job_emitter.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
notifier_helper.go Fix various typos in codebase (#35480) 2025-09-13 10:34:43 -04:00
notifier.go [Fix] Trigger 'unlabeled' event when label is Deleted from PR (#34316) 2025-09-24 09:45:38 -07:00
rerun_test.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +00:00
rerun.go Fix bugs in rerunning jobs (#29955) 2024-03-22 03:19:17 +00:00
schedule_tasks.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00
task.go Enable addtional linters (#34085) 2025-04-01 10:14:01 +00:00
variables.go Added Description Field for Secrets and Variables (#33526) 2025-03-17 19:24:54 +00:00
workflow.go Add workflow_run api + webhook (#33964) 2025-06-20 20:14:00 +08:00