Skip to content

Commit 0f4f298

Browse files
committed
Install oras CLI in markstale.ps1 instead of throwing
The refactored markstale.ps1 expected oras to be pre-installed on the runner, but GitHub Actions runners don't have it. This restores the original behavior of downloading oras on-the-fly when it's not available, fixing the MarkOldImagesStale job failure.
1 parent 29672eb commit 0f4f298

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

build/markstale.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ param(
66
)
77

88
if (-not (Get-Command -name "oras" -ErrorAction SilentlyContinue)) {
9-
throw "Please install the ORAS CLI before running this script e.g. via 'winget install oras-cli' or 'choco install oras-cli'"
9+
$version = "1.2.0"
10+
$filename = Join-Path $env:TEMP "oras_$($version)_windows_amd64.zip"
11+
$orasPath = Join-Path $env:TEMP "oras"
12+
Write-Host "Installing ORAS CLI v$version..."
13+
Invoke-RestMethod -Method GET -UseBasicParsing -Uri "https://github.com/oras-project/oras/releases/download/v$($version)/oras_$($version)_windows_amd64.zip" -OutFile $filename
14+
Expand-Archive -Path $filename -DestinationPath $orasPath -Force
15+
$env:PATH = "$orasPath;$env:PATH"
1016
}
1117

1218
az acr login --name $PushRegistry

0 commit comments

Comments
 (0)