@@ -915,21 +915,6 @@ func Routes() *web.Router {
915915 })
916916 }
917917
918- addActionsWorkflowRoutes := func (
919- m * web.Router ,
920- actw actions.WorkflowAPI ,
921- ) {
922- m .Group ("/actions" , func () {
923- m .Group ("/workflows" , func () {
924- m .Get ("" , reqToken (), actw .ListRepositoryWorkflows )
925- m .Get ("/{workflow_id}" , reqToken (), actw .GetWorkflow )
926- m .Put ("/{workflow_id}/disable" , reqToken (), reqRepoWriter (unit .TypeActions ), actw .DisableWorkflow )
927- m .Post ("/{workflow_id}/dispatches" , reqToken (), reqRepoWriter (unit .TypeActions ), bind (api.CreateActionWorkflowDispatch {}), actw .DispatchWorkflow )
928- m .Put ("/{workflow_id}/enable" , reqToken (), reqRepoWriter (unit .TypeActions ), actw .EnableWorkflow )
929- }, context .ReferencesGitRepo (), reqRepoReader (unit .TypeActions ))
930- })
931- }
932-
933918 m .Group ("" , func () {
934919 // Miscellaneous (no scope required)
935920 if setting .API .EnableSwagger {
@@ -1170,15 +1155,17 @@ func Routes() *web.Router {
11701155 m .Post ("/accept" , repo .AcceptTransfer )
11711156 m .Post ("/reject" , repo .RejectTransfer )
11721157 }, reqToken ())
1173- addActionsRoutes (
1174- m ,
1175- reqOwner (),
1176- repo .NewAction (),
1177- )
1178- addActionsWorkflowRoutes (
1179- m ,
1180- repo .NewActionWorkflow (),
1181- )
1158+
1159+ addActionsRoutes (m , reqOwner (), repo .NewAction ()) // it adds the routes for secrets/variables and runner management
1160+
1161+ m .Group ("/actions/workflows" , func () {
1162+ m .Get ("" , reqToken (), repo .ActionsListRepositoryWorkflows )
1163+ m .Get ("/{workflow_id}" , reqToken (), repo .ActionsGetWorkflow )
1164+ m .Put ("/{workflow_id}/disable" , reqToken (), reqRepoWriter (unit .TypeActions ), repo .ActionsDisableWorkflow )
1165+ m .Post ("/{workflow_id}/dispatches" , reqToken (), reqRepoWriter (unit .TypeActions ), bind (api.CreateActionWorkflowDispatch {}), repo .ActionsDispatchWorkflow )
1166+ m .Put ("/{workflow_id}/enable" , reqToken (), reqRepoWriter (unit .TypeActions ), repo .ActionsEnableWorkflow )
1167+ }, context .ReferencesGitRepo (), reqRepoReader (unit .TypeActions ))
1168+
11821169 m .Group ("/hooks/git" , func () {
11831170 m .Combo ("" ).Get (repo .ListGitHooks )
11841171 m .Group ("/{id}" , func () {
0 commit comments