Add new path for Ubuntu runner (#129)

* Add new path for actions-runner

* Improve log path retrieval in Get-UseGoLogs

Refactor Get-UseGoLogs function to find logs paths based on Runner.Listener process location.
This commit is contained in:
Haritha
2026-01-15 20:46:01 -06:00
committed by GitHub
parent cfaea8634b
commit 0e494735ab

View File

@@ -8,15 +8,26 @@ Describe "Go" {
$sourceLocation = Get-Location $sourceLocation = Get-Location
function Get-UseGoLogs { function Get-UseGoLogs {
# GitHub Windows images don't have `HOME` variable $runnerProc = Get-Process -Name "Runner.Listener" -ErrorAction SilentlyContinue | Select-Object -First 1
$homeDir = $env:HOME ?? $env:HOMEDRIVE #Write-Host "`$runnerProc: $($runnerProc | Out-String)"
$possiblePaths = @( if (-not $runnerProc -or -not $runnerProc.Path) {
Join-Path -Path $homeDir -ChildPath "actions-runner/cached/_diag/pages" Write-Error "Runner.Listener process not found."
Join-Path -Path $homeDir -ChildPath "runners/*/_diag/pages" return
) }
# Go up two directories to get runner root
$runnerRoot = Split-Path (Split-Path $runnerProc.Path -Parent) -Parent
#Write-Host "`$runnerRoot: $runnerRoot"
# Recursively find all _diag/pages folders under the runner root directory
$possiblePaths = Get-ChildItem -Path $runnerRoot -Directory -Recurse -Depth 4 -ErrorAction SilentlyContinue |
Where-Object { $_.FullName -like "*_diag\pages" -or $_.FullName -like "*_diag/pages" }
Write-Host "LogsPaths:"
$possiblePaths | ForEach-Object { Write-Host $_.FullName }
$logsFolderPath = $possiblePaths | Where-Object { Test-Path $_ } | Select-Object -First 1 $logsFolderPath = $possiblePaths | Where-Object { Test-Path $_ } | Select-Object -First 1
$resolvedPath = Resolve-Path -Path $logsFolderPath -ErrorAction SilentlyContinue if ($logsFolderPath) {
$resolvedPath = Resolve-Path -Path $logsFolderPath -ErrorAction SilentlyContinue
}
if ($resolvedPath -and -not [string]::IsNullOrEmpty($resolvedPath.Path) -and (Test-Path $resolvedPath.Path)) { if ($resolvedPath -and -not [string]::IsNullOrEmpty($resolvedPath.Path) -and (Test-Path $resolvedPath.Path)) {
$useGoLogFile = Get-ChildItem -Path $resolvedPath | Where-Object { $useGoLogFile = Get-ChildItem -Path $resolvedPath | Where-Object {