readLockFileFromHEAD reads a lock file from git HEAD using the compiler's cached git root directory, avoiding the overhead of spawning a subprocess to re-discover the repository root on every call.
(lockFile string)
| 390 | // git root directory, avoiding the overhead of spawning a subprocess to re-discover |
| 391 | // the repository root on every call. |
| 392 | func (c *Compiler) readLockFileFromHEAD(lockFile string) (string, error) { |
| 393 | if c.gitRoot == "" { |
| 394 | return "", errors.New("git root not available (not in a git repository or git not installed)") |
| 395 | } |
| 396 | return gitutil.ReadFileFromHEAD(lockFile, c.gitRoot) |
| 397 | } |
| 398 | |
| 399 | // CompileWorkflowData compiles pre-parsed workflow content into GitHub Actions YAML. |
| 400 | // Unlike CompileWorkflow, this accepts already-parsed frontmatter and markdown content |