| 93 | * the workflows that actually run for this code instead of silently no-oping. |
| 94 | */ |
| 95 | export function resolveWorkflowsDir(root: string): string { |
| 96 | let current = root; |
| 97 | |
| 98 | for (;;) { |
| 99 | const candidate = join(current, ".github", "workflows"); |
| 100 | |
| 101 | if (existsSync(candidate)) { |
| 102 | return candidate; |
| 103 | } |
| 104 | |
| 105 | const parent = dirname(current); |
| 106 | |
| 107 | if (parent === current) { |
| 108 | return join(root, ".github", "workflows"); |
| 109 | } |
| 110 | |
| 111 | current = parent; |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | export function buildContext(root: string): IMetaContext { |
| 116 | const sourceFiles = [ |