Skip to content

Commit a3ac67b

Browse files
committed
fix: version isn't deleted if it's the only version and max-versions-to-keep is 1
Resolves #307
1 parent b87a066 commit a3ac67b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ runs:
9090
run: |
9191
# delete previous versions w.r.t. max-versions-to-keep (if any)
9292
$ToNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
93-
$Versions = komac list-versions '${{ inputs.identifier }}' --json | ConvertFrom-Json | Sort-Object $ToNatural -Descending
93+
#[Issue #307] -NoEnumerate has been added so that $Versions does not get converted to a string, when only one version exists in winget-pkgs
94+
$Versions = komac list-versions '${{ inputs.identifier }}' --json | ConvertFrom-Json -NoEnumerate | Sort-Object $ToNatural -Descending
9495
$Reason = 'This version is older than what has been set in `max-versions-to-keep` by the publisher.'
9596
9697
If ($Versions.Count + 1 -gt ${{ inputs.max-versions-to-keep }}) {

0 commit comments

Comments
 (0)