Files
runner-images-sangeeth/images/windows/scripts/build/Install-ActionsCache.ps1
Vasilii Polikarpov da1c04b81a [Windows] Reimplement function resolving GH asset (#8899)
* [Windows] Reimplement function resolving GH asset

* Fix tests and software report

* Fix selenium-server version check
2023-11-28 15:08:03 +01:00

24 lines
1.1 KiB
PowerShell

################################################################################
## File: Install-ActionsCache.ps1
## Desc: Downloads latest release from https://github.com/actions/action-versions
## Maintainer: #actions-runtime and @TingluoHuang
################################################################################
if (-not (Test-Path $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE)) {
Write-Host "Creating action archive cache folder"
New-Item -ItemType Directory -Path $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE | Out-Null
}
$downloadUrl = Resolve-GithubReleaseAssetUrl `
-Repo "actions/action-versions" `
-Version "latest" `
-Asset "action-versions.zip"
Write-Host "Download Latest action-versions archive from $downloadUrl"
$actionVersionsArchivePath = Start-DownloadWithRetry -Url $downloadUrl -Name "action-versions.zip"
Write-Host "Expand action-versions archive"
Expand-7ZipArchive -Path $actionVersionsArchivePath -DestinationPath $env:ACTIONS_RUNNER_ACTION_ARCHIVE_CACHE
Invoke-PesterTests -TestFile "ActionArchiveCache"