diff options
author | yp05327 <576951401@qq.com> | 2024-02-18 19:58:46 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-18 10:58:46 +0000 |
commit | 1a6e1cbada27db1e3327b0d7d331492c95e24759 (patch) | |
tree | f508bb8ab68451d1293e1180ff0e9e164d6c8816 /modules/actions | |
parent | 67adc5c1dc3470dab96053c2e77351f3a3f8062b (diff) | |
download | gitea-1a6e1cbada27db1e3327b0d7d331492c95e24759.tar.gz gitea-1a6e1cbada27db1e3327b0d7d331492c95e24759.zip |
Implement some action notifier functions (#29173)
Fix #29166
Add support for the following activity types of `pull_request`
- assigned
- unassigned
- review_requested
- review_request_removed
- milestoned
- demilestoned
Diffstat (limited to 'modules/actions')
-rw-r--r-- | modules/actions/github.go | 4 | ||||
-rw-r--r-- | modules/actions/workflows.go | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/modules/actions/github.go b/modules/actions/github.go index fafea4e11a..18917c5118 100644 --- a/modules/actions/github.go +++ b/modules/actions/github.go @@ -52,7 +52,9 @@ func canGithubEventMatch(eventName string, triggedEvent webhook_module.HookEvent case webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync, webhook_module.HookEventPullRequestAssign, - webhook_module.HookEventPullRequestLabel: + webhook_module.HookEventPullRequestLabel, + webhook_module.HookEventPullRequestReviewRequest, + webhook_module.HookEventPullRequestMilestone: return true default: diff --git a/modules/actions/workflows.go b/modules/actions/workflows.go index a883f4181b..2db4a9296f 100644 --- a/modules/actions/workflows.go +++ b/modules/actions/workflows.go @@ -221,7 +221,9 @@ func detectMatched(gitRepo *git.Repository, commit *git.Commit, triggedEvent web webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync, webhook_module.HookEventPullRequestAssign, - webhook_module.HookEventPullRequestLabel: + webhook_module.HookEventPullRequestLabel, + webhook_module.HookEventPullRequestReviewRequest, + webhook_module.HookEventPullRequestMilestone: return matchPullRequestEvent(gitRepo, commit, payload.(*api.PullRequestPayload), evt) case // pull_request_review @@ -397,13 +399,13 @@ func matchPullRequestEvent(gitRepo *git.Repository, commit *git.Commit, prPayloa } else { // See https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request // Actions with the same name: - // opened, edited, closed, reopened, assigned, unassigned + // opened, edited, closed, reopened, assigned, unassigned, review_requested, review_request_removed, milestoned, demilestoned // Actions need to be converted: // synchronized -> synchronize // label_updated -> labeled // label_cleared -> unlabeled // Unsupported activity types: - // converted_to_draft, ready_for_review, locked, unlocked, review_requested, review_request_removed, auto_merge_enabled, auto_merge_disabled + // converted_to_draft, ready_for_review, locked, unlocked, auto_merge_enabled, auto_merge_disabled, enqueued, dequeued action := prPayload.Action switch action { |