Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude previous pre-release version of the AL Language #779

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/actions/marketplace/Get-Marketplace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,27 @@ $listing = Invoke-WebRequest -Method POST -UseBasicParsing `
-Body '{"filters":[{"criteria":[{"filterType":4,"value":"fe889a8a-1498-4047-850d-eb8ea82de1d1"}],"pageNumber":1,"pageSize":50,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":0x12}' `
-ContentType application/json | ConvertFrom-Json

# Filter out versions below v12
$listingFiltered = $listing.results | Select-Object -First 1 -ExpandProperty extensions `
| Select-Object -ExpandProperty versions `
| Where-Object { $(ConvertTo-Version($_.version)) -gt [System.Version]::Parse("12.0.0") }

# Find current release version
$currentRelease = $listingFiltered `
| Where-Object properties -ne $null `
| Where-Object { $_.properties.key -notcontains 'Microsoft.VisualStudio.Code.PreRelease' } `
| Select-Object -First 1 -ExpandProperty version

# Remove pre-release versions lower than currentRelease
$listingFiltered = $listingFiltered `
| Where-Object {
$version = ConvertTo-Version($_.version)
$preRelease = $_.properties | Where-Object { $_.key -eq 'Microsoft.VisualStudio.Code.PreRelease' }

if ($preRelease -and $version -lt (ConvertTo-Version $currentRelease)) {
return $false
}
return $true
}

Write-Output $listingFiltered | ConvertTo-Json -Compress -Depth 3