MCPcopy Create free account
hub / github.com/github/gh-aw / TestFindRunnableWorkflows

Function TestFindRunnableWorkflows

pkg/cli/run_interactive_test.go:16–149  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestFindRunnableWorkflows(t *testing.T) {
17 // Create a temporary directory for test workflows
18 tempDir := t.TempDir()
19 workflowsDir := filepath.Join(tempDir, ".github", "workflows")
20 require.NoError(t, os.MkdirAll(workflowsDir, 0755))
21
22 // Create test workflow files
23 tests := []struct {
24 name string
25 mdContent string
26 lockContent string
27 shouldFind bool
28 }{
29 {
30 name: "workflow-dispatch.md",
31 mdContent: `---
32on:
33 workflow_dispatch:
34---
35# Test Workflow with workflow_dispatch
36`,
37 lockContent: `name: "Test Workflow"
38on:
39 workflow_dispatch:
40jobs:
41 test:
42 runs-on: ubuntu-latest
43 steps:
44 - run: echo "test"
45`,
46 shouldFind: true,
47 },
48 {
49 name: "schedule.md",
50 mdContent: `---
51on:
52 schedule:
53 - cron: "0 0 * * *"
54---
55# Test Workflow with schedule
56`,
57 lockContent: `name: "Test Workflow"
58on:
59 schedule:
60 - cron: "0 0 * * *"
61 workflow_dispatch:
62jobs:
63 test:
64 runs-on: ubuntu-latest
65 steps:
66 - run: echo "test"
67`,
68 shouldFind: true,
69 },
70 {
71 name: "push-only.md",
72 mdContent: `---
73on:

Callers

nothing calls this directly

Calls 1

findRunnableWorkflowsFunction · 0.85

Tested by

no test coverage detected