(filePath, sectionName string, content []byte, visited map[string]struct {
}, extractTools bool)
| 322 | } |
| 323 | |
| 324 | func extractIncludedMarkdownContent(filePath, sectionName string, content []byte, visited map[string]struct { |
| 325 | }, extractTools bool) (string, error) { |
| 326 | markdownContent, err := ExtractMarkdownContent(string(content)) |
| 327 | if err != nil { |
| 328 | return "", fmt.Errorf("failed to extract markdown from %s: %w", filePath, err) |
| 329 | } |
| 330 | |
| 331 | includedDir := filepath.Dir(filePath) |
| 332 | markdownContent, err = processIncludesWithVisited(markdownContent, includedDir, extractTools, visited) |
| 333 | if err != nil { |
| 334 | return "", fmt.Errorf("failed to process nested includes in %s: %w", filePath, err) |
| 335 | } |
| 336 | if sectionName != "" { |
| 337 | sectionContent, sectionErr := ExtractMarkdownSection(markdownContent, sectionName) |
| 338 | if sectionErr != nil { |
| 339 | return "", fmt.Errorf("failed to extract section '%s' from %s: %w", sectionName, filePath, sectionErr) |
| 340 | } |
| 341 | return strings.Trim(sectionContent, "\n") + "\n", nil |
| 342 | } |
| 343 | return strings.Trim(markdownContent, "\n") + "\n", nil |
| 344 | } |
| 345 | |
| 346 | // frontmatterContainsExpressions reports whether any string value in the frontmatter map |
| 347 | // (recursively) contains an unsubstituted ${{ }} expression. Shared workflows that use |
no test coverage detected