Skip to content

Commit dd65682

Browse files
fix(scripts): use full file paths for CI annotations and step summary
- pass $file.FullName to Write-CIAnnotation for correct GitHub Actions file linking - store fullPath in results and use it in step summary failure table - matches Invoke-PSScriptAnalyzer.ps1 pattern of using absolute paths 🔧 - Generated by Copilot
1 parent 6de8e85 commit dd65682

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

scripts/linting/Test-CopyrightHeaders.ps1

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function Test-FileHeaders {
9595

9696
$result = @{
9797
file = $FilePath -replace [regex]::Escape($Path), '' -replace '^[\\/]', ''
98+
fullPath = $FilePath
9899
hasCopyright = $false
99100
hasSpdx = $false
100101
valid = $false
@@ -221,7 +222,7 @@ function Invoke-CopyrightHeaderCheck {
221222
Write-CIAnnotation `
222223
-Message "Missing required headers: $($missing -join ', ')" `
223224
-Level Warning `
224-
-File $fileResult.file `
225+
-File $file.FullName `
225226
-Line 1
226227
}
227228

@@ -262,7 +263,7 @@ function Invoke-CopyrightHeaderCheck {
262263
$m = @()
263264
if (-not $_.hasCopyright) { $m += 'copyright' }
264265
if (-not $_.hasSpdx) { $m += 'SPDX' }
265-
"| ``$($_.file)`` | $($m -join ', ') |"
266+
"| ``$($_.fullPath)`` | $($m -join ', ') |"
266267
}) -join "`n"
267268

268269
Write-CIStepSummary -Content @"

0 commit comments

Comments
 (0)