aboutsummaryrefslogtreecommitdiffstats
path: root/models/actions/run.go
diff options
context:
space:
mode:
authorsillyguodong <33891828+sillyguodong@users.noreply.github.com>2023-03-25 04:05:48 +0800
committerGitHub <noreply@github.com>2023-03-24 16:05:48 -0400
commit023e61e678dc353fa6c9b0299c37f48e98a3c7af (patch)
treece803d784046a2ffbb2b8ce06fae292329800dbb /models/actions/run.go
parentaa3c67362182d4c11dffa44ab355b5fea2ab78f9 (diff)
downloadgitea-023e61e678dc353fa6c9b0299c37f48e98a3c7af.tar.gz
gitea-023e61e678dc353fa6c9b0299c37f48e98a3c7af.zip
Create commit status when event is `pull_request_sync` (#23683)
Fix: #23674 If the type of `hook_event` is `pull_request_sync`, also need to insert a record of `commit_status` into DB. Because `pull_request` event and `pull_request_sync` event have the same payload, so the code is reusable. Screenshot: ![image](https://user-images.githubusercontent.com/33891828/227465436-1b436807-d0b2-4a2b-8890-09d96c7f666d.png)
Diffstat (limited to 'models/actions/run.go')
-rw-r--r--models/actions/run.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/models/actions/run.go b/models/actions/run.go
index a711cfee2e..1af8f897fa 100644
--- a/models/actions/run.go
+++ b/models/actions/run.go
@@ -129,7 +129,7 @@ func (run *ActionRun) GetPushEventPayload() (*api.PushPayload, error) {
}
func (run *ActionRun) GetPullRequestEventPayload() (*api.PullRequestPayload, error) {
- if run.Event == webhook_module.HookEventPullRequest {
+ if run.Event == webhook_module.HookEventPullRequest || run.Event == webhook_module.HookEventPullRequestSync {
var payload api.PullRequestPayload
if err := json.Unmarshal([]byte(run.EventPayload), &payload); err != nil {
return nil, err