diff --git a/services/actions/context.go b/services/actions/context.go index 97303afe8e..b47940fa5e 100644 --- a/services/actions/context.go +++ b/services/actions/context.go @@ -115,7 +115,8 @@ func GenerateGiteaContext(run *actions_model.ActionRun, job *actions_model.Actio gitContext["workflow"] = run.WorkflowID // string, The name of the workflow. If the workflow file doesn't specify a name, the value of this property is the full path of the workflow file in the repository. // additional contexts - gitContext["gitea_default_actions_url"] = setting.Actions.DefaultActionsURL.URL() + gitContext["gitea_default_actions_url"] = setting.Actions.DefaultActionsURL.URL() // Remove after Forgejo 19. + gitContext["forgejo_default_actions_url"] = setting.Actions.DefaultActionsURL.URL() gitContext["forgejo_server_version"] = setting.AppVer if job != nil { diff --git a/services/actions/context_test.go b/services/actions/context_test.go index 5abd8afb00..19d1b10d1a 100644 --- a/services/actions/context_test.go +++ b/services/actions/context_test.go @@ -90,6 +90,9 @@ func TestGenerateGiteaContext(t *testing.T) { assert.Equal(t, false, context["ref_protected"]) assert.Equal(t, "Actions", context["secret_source"]) assert.Equal(t, setting.AppURL, context["server_url"]) + assert.Equal(t, setting.Actions.DefaultActionsURL.URL(), context["gitea_default_actions_url"]) + assert.Equal(t, setting.Actions.DefaultActionsURL.URL(), context["forgejo_default_actions_url"]) + assert.Equal(t, setting.AppVer, context["forgejo_server_version"]) event, ok := context["event"].(map[string]any) require.True(t, ok)