File tree 2 files changed +10
-4
lines changed 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ func MustEnableActions(ctx *context.Context) {
61
61
return
62
62
}
63
63
}
64
+
64
65
}
65
66
66
67
func List (ctx * context.Context ) {
@@ -208,6 +209,10 @@ func List(ctx *context.Context) {
208
209
actionsConfig := ctx .Repo .Repository .MustGetUnit (ctx , unit .TypeActions ).ActionsConfig ()
209
210
ctx .Data ["ActionsConfig" ] = actionsConfig
210
211
212
+ if strings .HasSuffix (ctx .Repo .Repository .Name , ".workflow" ) {
213
+ ctx .Data ["AllowGlobalWorkflow" ] = true
214
+ }
215
+
211
216
if len (workflowID ) > 0 && ctx .Repo .IsAdmin () {
212
217
ctx .Data ["AllowDisableOrEnableWorkflow" ] = true
213
218
isWorkflowDisabled := actionsConfig .IsWorkflowDisabled (workflowID )
Original file line number Diff line number Diff line change 81
81
<a class="item link-action" data-url="{{$.Link}}/{{if .CurWorkflowDisabled}}enable{{else}}disable{{end}}?workflow={{$.CurWorkflow}}&actor={{.CurActor}}&status={{$.CurStatus}}">
82
82
{{if .CurWorkflowDisabled}}{{ctx.Locale.Tr "actions.workflow.enable"}}{{else}}{{ctx.Locale.Tr "actions.workflow.disable"}}{{end}}
83
83
</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}}
88
89
</div>
89
90
</button>
90
91
{{end}}
You can’t perform that action at this time.
0 commit comments