mirror of
https://github.com/actions/runner-images.git
synced 2025-12-28 12:48:21 +08:00
macos-13: update XCode-15 to Beta 6 (#8076)
This commit is contained in:
@@ -86,14 +86,38 @@ function Invoke-RestMethodWithRetry {
|
||||
function Invoke-ValidateCommand {
|
||||
param(
|
||||
[Parameter(Mandatory)]
|
||||
[string]$Command
|
||||
[string]$Command,
|
||||
[Uint] $Timeout = 0
|
||||
)
|
||||
|
||||
$output = Invoke-Expression -Command $Command
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Command '$Command' has finished with exit code $LASTEXITCODE"
|
||||
if ($Timeout -eq 0)
|
||||
{
|
||||
$output = Invoke-Expression -Command $Command
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw "Command '$Command' has finished with exit code $LASTEXITCODE"
|
||||
}
|
||||
return $output
|
||||
}
|
||||
else
|
||||
{
|
||||
$job = $command | Start-Job -ScriptBlock {
|
||||
$output = Invoke-Expression -Command $input
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
throw 'Command failed'
|
||||
}
|
||||
return $output
|
||||
}
|
||||
$waitObject = $job | Wait-Job -Timeout $Timeout
|
||||
if(-not $waitObject)
|
||||
{
|
||||
throw "Command '$Command' has timed out"
|
||||
}
|
||||
if($waitObject.State -eq 'Failed')
|
||||
{
|
||||
throw "Command '$Command' has failed"
|
||||
}
|
||||
Receive-Job -Job $job
|
||||
}
|
||||
return $output
|
||||
}
|
||||
|
||||
function Start-DownloadWithRetry {
|
||||
|
||||
Reference in New Issue
Block a user