mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-14 13:56:47 +00:00
feat: Return apt packages with their installed versions (#2939)
This commit is contained in:
@@ -295,10 +295,20 @@ function Get-CachedDockerImagesTableData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-AptPackages {
|
function Get-AptPackages {
|
||||||
$toolsetJson = Get-ToolsetContent
|
$apt = (Get-ToolsetContent).Apt
|
||||||
$apt = $toolsetJson.apt
|
$output = @()
|
||||||
$pkgs = ($apt.common_packages + $apt.cmd_packages | Sort-Object) -join ", "
|
ForEach ($pkg in ($apt.common_packages + $apt.cmd_packages)) {
|
||||||
return $pkgs
|
$version = $(dpkg-query -W -f '${Version}' $pkg)
|
||||||
|
if ($Null -eq $version) {
|
||||||
|
$version = $(dpkg-query -W -f '${Version}' "$pkg*")
|
||||||
|
}
|
||||||
|
|
||||||
|
$output += [PSCustomObject] @{
|
||||||
|
Name = $pkg
|
||||||
|
Version = $version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ($output | Sort-Object Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-PipxVersion {
|
function Get-PipxVersion {
|
||||||
|
|||||||
@@ -286,6 +286,6 @@ $markdown += Get-CachedDockerImagesTableData | New-MDTable
|
|||||||
$markdown += New-MDNewLine
|
$markdown += New-MDNewLine
|
||||||
|
|
||||||
$markdown += New-MDHeader "Installed apt packages" -Level 3
|
$markdown += New-MDHeader "Installed apt packages" -Level 3
|
||||||
$markdown += New-MDList -Style Unordered -Lines @(Get-AptPackages)
|
$markdown += Get-AptPackages | New-MDTable
|
||||||
|
|
||||||
$markdown | Out-File -FilePath "${OutputDirectory}/Ubuntu-Readme.md"
|
$markdown | Out-File -FilePath "${OutputDirectory}/Ubuntu-Readme.md"
|
||||||
|
|||||||
Reference in New Issue
Block a user