| 48 | } |
| 49 | |
| 50 | func resolveWorkflowExtension(fileResult *findWorkflowFileResult) (string, bool) { |
| 51 | if fileResult.lockExists { |
| 52 | safeOutputsWorkflowHelpersLog.Print("Resolved workflow extension: .lock.yml (lock file exists)") |
| 53 | return ".lock.yml", true |
| 54 | } |
| 55 | if fileResult.ymlExists { |
| 56 | safeOutputsWorkflowHelpersLog.Print("Resolved workflow extension: .yml (yml file exists)") |
| 57 | return ".yml", true |
| 58 | } |
| 59 | if fileResult.mdExists { |
| 60 | // .md-only: the workflow is a same-batch compilation target that will produce a .lock.yml |
| 61 | safeOutputsWorkflowHelpersLog.Print("Resolved workflow extension: .lock.yml (md-only, same-batch target)") |
| 62 | return ".lock.yml", true |
| 63 | } |
| 64 | |
| 65 | safeOutputsWorkflowHelpersLog.Print("Failed to resolve workflow extension: no candidate files exist") |
| 66 | return "", false |
| 67 | } |