Skip to content
This repository has been archived by the owner on Feb 13, 2024. It is now read-only.

Commit

Permalink
Fix bug where last version would be selected from github releases
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisonmeister committed Feb 8, 2024
1 parent 9795b01 commit c54312a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@ jobs:
$releasesUrl = "https://api.github.com/repos/$Repository/releases"
$tags = (Invoke-WebRequest $releasesUrl -UseBasicParsing | ConvertFrom-Json)
$latestLiquibaseVersion = $null
$tagsWithAssets = @($tags | Where-Object {$_.assets.Count -gt 0 })
foreach ($tag in $tags) {
if ($tag.assets.Count -gt 0) {
$latestLiquibaseVersion = ($tag.tag_name.Replace("v", ""))
}
if($null -eq $tagsWithAssets) {
throw "No valid tags found for liquibase tool!"
}
$latestLiquibaseTag = ($tagsWithAssets | Select-Object -First 1)
$latestLiquibaseVersion = $latestLiquibaseTag.tag_name -Replace "v",""
$workerToolsTags = (Invoke-RestMethod "https://registry.hub.docker.com/v2/repositories/octopuslabs/liquibase-workertools/tags?page_size=50")
$matchingTag = $workerToolsTags.results | Where-Object { $_.name -eq $latestLiquibaseVersion }
Expand Down

0 comments on commit c54312a

Please sign in to comment.