From cae73af8c09b7416846b1ee1e7a765d697f63f76 Mon Sep 17 00:00:00 2001 From: Zettat123 Date: Mon, 6 Jan 2025 12:03:52 +0800 Subject: [PATCH] support label event --- models/actions/run.go | 4 +++- services/actions/commit_status.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/models/actions/run.go b/models/actions/run.go index a224a910ab59a..ac76366ae98e2 100644 --- a/models/actions/run.go +++ b/models/actions/run.go @@ -154,7 +154,9 @@ func (run *ActionRun) GetPushEventPayload() (*api.PushPayload, error) { } func (run *ActionRun) GetPullRequestEventPayload() (*api.PullRequestPayload, error) { - if run.Event == webhook_module.HookEventPullRequest || run.Event == webhook_module.HookEventPullRequestSync { + if run.Event == webhook_module.HookEventPullRequest || + run.Event == webhook_module.HookEventPullRequestSync || + run.Event == webhook_module.HookEventPullRequestLabel { var payload api.PullRequestPayload if err := json.Unmarshal([]byte(run.EventPayload), &payload); err != nil { return nil, err diff --git a/services/actions/commit_status.go b/services/actions/commit_status.go index 7f52c9d31b590..c2c05e0a60206 100644 --- a/services/actions/commit_status.go +++ b/services/actions/commit_status.go @@ -54,7 +54,9 @@ func createCommitStatus(ctx context.Context, job *actions_model.ActionRunJob) er return fmt.Errorf("head commit is missing in event payload") } sha = payload.HeadCommit.ID - case webhook_module.HookEventPullRequest, webhook_module.HookEventPullRequestSync: + case webhook_module.HookEventPullRequest, + webhook_module.HookEventPullRequestSync, + webhook_module.HookEventPullRequestLabel: if run.TriggerEvent == actions_module.GithubEventPullRequestTarget { event = "pull_request_target" } else {