Skip to content

Commit e53c6e1

Browse files
committed
remove unused code
1 parent 4ae804f commit e53c6e1

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

services/actions/utils.go

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,6 @@ func GenerateGitContext(run *actions_model.ActionRun, job *actions_model.ActionR
2222
event := map[string]any{}
2323
_ = json.Unmarshal([]byte(run.EventPayload), &event)
2424

25-
// TriggerEvent is added in https://github.com/go-gitea/gitea/pull/25229
26-
// This fallback is for the old ActionRun that doesn't have the TriggerEvent field
27-
// and should be removed in 1.22
28-
eventName := run.TriggerEvent
29-
if eventName == "" {
30-
eventName = run.Event.Event()
31-
}
32-
3325
baseRef := ""
3426
headRef := ""
3527
ref := run.Ref
@@ -61,7 +53,7 @@ func GenerateGitContext(run *actions_model.ActionRun, job *actions_model.ActionR
6153
"base_ref": baseRef, // string, The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.
6254
"env": "", // string, Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "Workflow commands for GitHub Actions."
6355
"event": event, // object, The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in "Events that trigger workflows." For example, for a workflow run triggered by the push event, this object contains the contents of the push webhook payload.
64-
"event_name": eventName, // string, The name of the event that triggered the workflow run.
56+
"event_name": run.TriggerEvent, // string, The name of the event that triggered the workflow run.
6557
"event_path": "", // string, The path to the file on the runner that contains the full event webhook payload.
6658
"graphql_url": "", // string, The URL of the GitHub GraphQL API.
6759
"head_ref": headRef, // string, The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.

0 commit comments

Comments
 (0)