mirror of
https://github.com/go-gitea/gitea
synced 2024-11-10 20:24:24 +00:00
Support pull_request_target
event for commit status (#31703)
Fix [act_runner #573](https://gitea.com/gitea/act_runner/issues/573) Before: ![image](https://github.com/user-attachments/assets/3944bf7f-7a60-4801-bcb3-5e158a180fda) After: ![image](https://github.com/user-attachments/assets/cadac944-40bd-4537-a9d9-e702b8bc1ece)
This commit is contained in:
parent
930ca92d7c
commit
4b376a0ed9
@ -12,6 +12,7 @@ import (
|
|||||||
"code.gitea.io/gitea/models/db"
|
"code.gitea.io/gitea/models/db"
|
||||||
git_model "code.gitea.io/gitea/models/git"
|
git_model "code.gitea.io/gitea/models/git"
|
||||||
user_model "code.gitea.io/gitea/models/user"
|
user_model "code.gitea.io/gitea/models/user"
|
||||||
|
actions_module "code.gitea.io/gitea/modules/actions"
|
||||||
git "code.gitea.io/gitea/modules/git"
|
git "code.gitea.io/gitea/modules/git"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
api "code.gitea.io/gitea/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
@ -54,7 +55,11 @@ func createCommitStatus(ctx context.Context, job *actions_model.ActionRunJob) er
|
|||||||
}
|
}
|
||||||
sha = payload.HeadCommit.ID
|
sha = payload.HeadCommit.ID
|
||||||
case webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync:
|
case webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync:
|
||||||
event = "pull_request"
|
if run.TriggerEvent == actions_module.GithubEventPullRequestTarget {
|
||||||
|
event = "pull_request_target"
|
||||||
|
} else {
|
||||||
|
event = "pull_request"
|
||||||
|
}
|
||||||
payload, err := run.GetPullRequestEventPayload()
|
payload, err := run.GetPullRequestEventPayload()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("GetPullRequestEventPayload: %w", err)
|
return fmt.Errorf("GetPullRequestEventPayload: %w", err)
|
||||||
|
Loading…
Reference in New Issue
Block a user