Fix software and release URLs for windows and ubuntu (#7790)

This commit is contained in:
Shamil Mubarakshin
2023-06-26 19:45:09 +02:00
committed by GitHub
parent 7d99ce2cad
commit 3ede1f95a7
2 changed files with 11 additions and 6 deletions

View File

@@ -4,17 +4,20 @@ $osName = $caption.Substring(0, $caption.LastIndexOf(" "))
$osEdition = $caption.Substring($caption.LastIndexOf(" ")+1)
$osVersion = $os.Version
$imageVersion = $env:IMAGE_VERSION
$imageVersionComponents = $imageVersion.Split('.')
$imageMajorVersion = $imageVersionComponents[0]
$imageMinorVersion = $imageVersionComponents[1]
$imageDataFile = $env:IMAGEDATA_FILE
$githubUrl="https://github.com/actions/runner-images/blob"
if (Test-IsWin22) {
$imageLabel = "windows-2022"
$softwareUrl = "${githubUrl}/win22/${imageVersion}/images/win/Windows2022-Readme.md"
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win22%2F${imageVersion}"
$softwareUrl = "${githubUrl}/win22/$imageMajorVersion.$imageMinorVersion/images/win/Windows2022-Readme.md"
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win22%2F$imageMajorVersion.$imageMinorVersion"
} elseif (Test-IsWin19) {
$imageLabel = "windows-2019"
$softwareUrl = "${githubUrl}/win19/${imageVersion}/images/win/Windows2019-Readme.md"
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win19%2F${imageVersion}"
$softwareUrl = "${githubUrl}/win19/$imageMajorVersion.$imageMinorVersion/images/win/Windows2019-Readme.md"
$releaseUrl="https://github.com/actions/runner-images/releases/tag/win19%2F$imageMajorVersion.$imageMinorVersion"
} else {
throw "Invalid platform version is found. Either Windows Server 2019 or 2022 are required"
}