File tree Expand file tree Collapse file tree 6 files changed +25
-8
lines changed Expand file tree Collapse file tree 6 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -205,6 +205,10 @@ func (cfg *ActionsConfig) EnableGlobalWorkflow(file string) {
205205 cfg .EnabledGlobalWorkflows = append (cfg .EnabledGlobalWorkflows , file )
206206}
207207
208+ func (cfg * ActionsConfig ) GetGlobalWorkflow () []string {
209+ return cfg .EnabledGlobalWorkflows
210+ }
211+
208212// FromDB fills up a ActionsConfig from serialized format.
209213func (cfg * ActionsConfig ) FromDB (bs []byte ) error {
210214 return json .UnmarshalHandleDoubleEncode (bs , & cfg )
@@ -215,6 +219,10 @@ func (cfg *ActionsConfig) ToDB() ([]byte, error) {
215219 return json .Marshal (cfg )
216220}
217221
222+ type FindEnabledGlobalWorkflowsOptions struct {
223+ db.ListOptions
224+ }
225+
218226// ProjectsMode represents the projects enabled for a repository
219227type ProjectsMode string
220228
Original file line number Diff line number Diff line change @@ -3623,9 +3623,11 @@ runners.reset_registration_token_success = Runner registration token reset succe
36233623
36243624require_actions = Require Actions
36253625require_actions.require_actions_manage_panel = Require Actions Management Panel
3626+ require_actions.enable_global_workflow = How to Enable Global Workflow
36263627require_actions.id = ID
36273628require_actions.name = Name
3628- require_actions.new = Create New
3629+ require_actions.add = Add Global Workflow
3630+ require_actions.add_require_actions = Enable selected Workflow
36293631require_actions.status = Status
36303632require_actions.version = Version
36313633require_actions.repo = Repo
Original file line number Diff line number Diff line change @@ -156,7 +156,6 @@ func List(ctx *context.Context) {
156156 ctx .Data ["AllowDisableOrEnableWorkflow" ] = true
157157 ctx .Data ["CurWorkflowDisabled" ] = actionsConfig .IsWorkflowDisabled (workflow )
158158 ctx .Data ["CurGlobalWorkflowEnable" ] = actionsConfig .IsGlobalWorkflowEnabled (workflow )
159-
160159 isGlobal = actionsConfig .IsGlobalWorkflowEnabled (workflow )
161160 }
162161
Original file line number Diff line number Diff line change @@ -451,11 +451,14 @@ func registerRoutes(m *web.Route) {
451451 // WIP RequireAction
452452 addSettingsRequireActionsRoutes := func () {
453453 m .Group ("/require_actions" , func () {
454- m .Get ("" , repo_setting .RequireActions )
455- m .Combo ("/{require_action_id}" ).Get (repo_setting .RequireActionsUpdate ).
456- Post (web .Bind (forms.EditRequireActionForm {}), repo_setting .RequireActionsUpdatePost )
457- m .Post ("/require_action_id}/delete" , repo_setting .RequireActionsDeletePost )
458-
454+ m .Get ("" , repo_setting .RequireActionsList )
455+ m .Post ("" , web .Bind (forms.EditRequireActionForm {}), repo_setting .RequireActionsCreate )
456+ m .Post ("/add" , web .Bind (forms.EditRequireActionForm {}), repo_setting .RequireActionsCreate )
457+ /*
458+ m.Combo("/{require_action_id}").Get(repo_setting.RequireActionsUpdate).
459+ Post(web.Bind(forms.EditRequireActionForm{}), repo_setting.RequireActionsUpdatePost)
460+ m.Post("/require_action_id}/delete", repo_setting.RequireActionsDeletePost)
461+ */
459462 })
460463 }
461464
Original file line number Diff line number Diff line change 11{{template "org/settings/layout_head" (dict "ctxData" . "pageClass" "organization settings actions")}}
22 <div class="org-setting-content">
3- {{if eq .PageType "runners"}}
3+ {{if eq .PageType "require_actions"}}
4+ {{template "shared/actions/require_action_list" .}}
5+ {{else if eq .PageType "runners"}}
46 {{template "shared/actions/runner_list" .}}
57 {{else if eq .PageType "secrets"}}
68 {{template "shared/secrets/add_list" .}}
Original file line number Diff line number Diff line change 2929 <details class="item toggleable-item" {{if or .PageIsSharedSettingsRunners .PageIsSharedSettingsSecrets .PageIsSharedSettingsVariables}}open{{end}}>
3030 <summary>{{ctx.Locale.Tr "actions.actions"}}</summary>
3131 <div class="menu">
32+ <a class="{{if .PageIsSharedSettingsRequireActions}}active {{end}}item" href="{{.OrgLink}}/settings/actions/require_actions">
33+ {{ctx.Locale.Tr "actions.require_actions"}}
34+ </a>
3235 <a class="{{if .PageIsSharedSettingsRunners}}active {{end}}item" href="{{.OrgLink}}/settings/actions/runners">
3336 {{ctx.Locale.Tr "actions.runners"}}
3437 </a>
You can’t perform that action at this time.
0 commit comments