Skip to content

Commit

Permalink
fix: version isn't deleted if it's the only version and max-versions-…
Browse files Browse the repository at this point in the history
…to-keep is 1

Resolves #307
  • Loading branch information
vedantmgoyal9 committed Nov 2, 2024
1 parent b87a066 commit a3ac67b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ runs:
run: |
# delete previous versions w.r.t. max-versions-to-keep (if any)
$ToNatural = { [regex]::Replace($_, '\d+', { $args[0].Value.PadLeft(20) }) }
$Versions = komac list-versions '${{ inputs.identifier }}' --json | ConvertFrom-Json | Sort-Object $ToNatural -Descending
#[Issue #307] -NoEnumerate has been added so that $Versions does not get converted to a string, when only one version exists in winget-pkgs
$Versions = komac list-versions '${{ inputs.identifier }}' --json | ConvertFrom-Json -NoEnumerate | Sort-Object $ToNatural -Descending
$Reason = 'This version is older than what has been set in `max-versions-to-keep` by the publisher.'
If ($Versions.Count + 1 -gt ${{ inputs.max-versions-to-keep }}) {
Expand Down

0 comments on commit a3ac67b

Please sign in to comment.