@@ -180,6 +180,35 @@ func TestEnableRun(t *testing.T) {
180180 },
181181 wantOut : "✓ Enabled a disabled workflow\n " ,
182182 },
183+ {
184+ name : "tty name arg inactivity workflow" ,
185+ opts : & EnableOptions {
186+ Selector : "a disabled inactivity workflow" ,
187+ },
188+ tty : true ,
189+ httpStubs : func (reg * httpmock.Registry ) {
190+ reg .Register (
191+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/workflows/a disabled inactivity workflow" ),
192+ httpmock .StatusStringResponse (404 , "not found" ))
193+ reg .Register (
194+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/workflows" ),
195+ httpmock .JSONResponse (shared.WorkflowsPayload {
196+ Workflows : []shared.Workflow {
197+ shared .AWorkflow ,
198+ shared .DisabledInactivityWorkflow ,
199+ shared .UniqueDisabledWorkflow ,
200+ shared .AnotherWorkflow ,
201+ },
202+ }))
203+ reg .Register (
204+ httpmock .REST ("PUT" , "repos/OWNER/REPO/actions/workflows/1206/enable" ),
205+ httpmock .StatusStringResponse (204 , "{}" ))
206+ },
207+ askStubs : func (as * prompt.AskStubber ) {
208+ as .StubOne (1 )
209+ },
210+ wantOut : "✓ Enabled a disabled inactivity workflow\n " ,
211+ },
183212 {
184213 name : "tty ID arg" ,
185214 opts : & EnableOptions {
@@ -235,6 +264,30 @@ func TestEnableRun(t *testing.T) {
235264 httpmock .StatusStringResponse (204 , "{}" ))
236265 },
237266 },
267+ {
268+ name : "nontty name arg inactivity workflow" ,
269+ opts : & EnableOptions {
270+ Selector : "a disabled inactivity workflow" ,
271+ },
272+ httpStubs : func (reg * httpmock.Registry ) {
273+ reg .Register (
274+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/workflows/a disabled inactivity workflow" ),
275+ httpmock .StatusStringResponse (404 , "not found" ))
276+ reg .Register (
277+ httpmock .REST ("GET" , "repos/OWNER/REPO/actions/workflows" ),
278+ httpmock .JSONResponse (shared.WorkflowsPayload {
279+ Workflows : []shared.Workflow {
280+ shared .AWorkflow ,
281+ shared .DisabledInactivityWorkflow ,
282+ shared .UniqueDisabledWorkflow ,
283+ shared .AnotherWorkflow ,
284+ },
285+ }))
286+ reg .Register (
287+ httpmock .REST ("PUT" , "repos/OWNER/REPO/actions/workflows/1206/enable" ),
288+ httpmock .StatusStringResponse (204 , "{}" ))
289+ },
290+ },
238291 {
239292 name : "nontty name arg nonunique" ,
240293 opts : & EnableOptions {
0 commit comments