Logs Path change

This commit is contained in:
HarithaVattikuti 2025-07-09 18:52:14 -05:00
parent a377a0baa6
commit bac9381d43

View file

@ -10,9 +10,14 @@ Describe "Go" {
function Get-UseGoLogs {
# GitHub Windows images don't have `HOME` variable
$homeDir = $env:HOME ?? $env:HOMEDRIVE
$logsFolderPath = Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" -Resolve
$possiblePaths = @(
Join-Path -Path $homeDir -ChildPath "actions-runner/cached/_diag/pages"
Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages"
)
$logsFolderPath = $possiblePaths | Where-Object { Test-Path $_ } | Select-Object -First 1
$useGoLogFile = Get-ChildItem -Path $logsFolderPath | Where-Object {
$useGoLogFile = Get-ChildItem -Path $logsFolderPath -File | Where-Object {
$logContent = Get-Content $_.Fullname -Raw
return $logContent -match "setup-go@v"
} | Select-Object -First 1