Skip to content

Commit 3db0a91

Browse files
committed
Fix Build-QnA.ps1
1 parent e5bb3be commit 3db0a91

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/scripts/Build-QnA.ps1

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,26 @@ foreach ($path in $possiblePaths) {
3333
Write-Host "Checking: $path"
3434
if (Test-Path $path) {
3535
$content = Get-Content -Path $path -Raw -Encoding UTF8
36+
Write-Host " File size: $($content.Length) chars"
37+
3638
# Check if file has actual QnA content (not just imports)
37-
if ($content -match "^#{1,2}\s*\?\s*.+$" -and $content.Length -gt 100) {
39+
# Use (?m) for multiline mode so ^ matches start of each line
40+
if ($content -match "(?m)^#\s*\?\s*.+" -and $content.Length -gt 100) {
3841
$inputFilePath = $path
3942
$qnaContent = $content
40-
Write-Host "Found QnA content in: $path"
43+
Write-Host " Found QnA content!"
4144
break
4245
}
4346
else {
44-
Write-Host "File exists but may only contain imports: $path"
47+
Write-Host " No QnA questions found (pattern: # ? question)"
48+
# Show first 200 chars for debugging
49+
$preview = if ($content.Length -gt 200) { $content.Substring(0, 200) } else { $content }
50+
Write-Host " Preview: $preview"
4551
}
4652
}
53+
else {
54+
Write-Host " File not found"
55+
}
4756
}
4857

4958
if (-not $inputFilePath -or -not $qnaContent) {

0 commit comments

Comments
 (0)