File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -208,6 +208,10 @@ func List(ctx *context.Context) {
208208 actionsConfig := ctx .Repo .Repository .MustGetUnit (ctx , unit .TypeActions ).ActionsConfig ()
209209 ctx .Data ["ActionsConfig" ] = actionsConfig
210210
211+ if strings .HasSuffix (ctx .Repo .Repository .Name , ".workflow" ) {
212+ ctx .Data ["AllowGlobalWorkflow" ] = true
213+ }
214+
211215 if len (workflowID ) > 0 && ctx .Repo .IsAdmin () {
212216 ctx .Data ["AllowDisableOrEnableWorkflow" ] = true
213217 isWorkflowDisabled := actionsConfig .IsWorkflowDisabled (workflowID )
Original file line number Diff line number Diff line change 8181 <a class="item link-action" data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
8282 {{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
8383 </a>
84- <a class="item link-action" data-url="{{$.Link}}/{{if .CurGlobalWorkflowEnable}}global_disable{{else}}global_enable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
85- {{if .CurGlobalWorkflowEnable}}{{ctx.Locale.Tr "actions.workflow.global_disable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.global_enable"}}{{end}}
86- </a>
87-
84+ {{if .AllowGlobalWorkflow}}
85+ <a class="item link-action" data-url="{{$.Link}}/{{if .CurGlobalWorkflowEnable}}global_disable{{else}}global_enable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
86+ {{if .CurGlobalWorkflowEnable}}{{ctx.Locale.Tr "actions.workflow.global_disable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.global_enable"}}{{end}}
87+ </a>
88+ {{end}}
8889 </div>
8990 </button>
9091 {{end}}
You can’t perform that action at this time.
0 commit comments