loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

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)

authored by

sillyguodong and committed by
GitHub
023e61e6 aa3c6736

+2 -2
+1 -1
models/actions/run.go
··· 129 129 } 130 130 131 131 func (run *ActionRun) GetPullRequestEventPayload() (*api.PullRequestPayload, error) { 132 - if run.Event == webhook_module.HookEventPullRequest { 132 + if run.Event == webhook_module.HookEventPullRequest || run.Event == webhook_module.HookEventPullRequestSync { 133 133 var payload api.PullRequestPayload 134 134 if err := json.Unmarshal([]byte(run.EventPayload), &payload); err != nil { 135 135 return nil, err
+1 -1
services/actions/commit_status.go
··· 45 45 46 46 sha = payload.HeadCommit.ID 47 47 creatorID = payload.Pusher.ID 48 - case webhook_module.HookEventPullRequest: 48 + case webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync: 49 49 payload, err := run.GetPullRequestEventPayload() 50 50 if err != nil { 51 51 return fmt.Errorf("GetPullRequestEventPayload: %w", err)