Skip to content

Commit

Permalink
Update action
Browse files Browse the repository at this point in the history
  • Loading branch information
justinyoo committed Apr 20, 2021
1 parent 87cb09a commit 9f46db3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
files: [ '**/*.bicep', 'sample1.bicep sample2.bicep biceps/sample3.bicep biceps/sample4.bicep' ]
version: [ 'latest', 'v0.3.255', 'v0.2.x' ]
version: [ '', 'latest', 'v0.3.255', 'v0.2.x' ]

steps:
- name: Checkout the repo
Expand Down
1 change: 1 addition & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ inputs:
version:
description: Version of the bicep CLI. It can be the exact version (eg. `v0.3.255`), wildcard (eg. `v0.3.x`) or `latest`. If omitted, `latest` is set as default.
required: false
default: 'latest'

runs:
using: docker
Expand Down
2 changes: 1 addition & 1 deletion entrypoint.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ $uri = "https://api.github.com/repos/Azure/bicep/releases"
$headers = @{ Accept = "application/vnd.github.v3+json" }

$releases = Invoke-RestMethod -Method GET -Uri $uri -Headers $headers
if ($Version -eq "latest") {
if (($Version -eq "latest") -or ($Version -eq "")) {
$release = ($releases | Select-Object -Property tag_name | Sort-Object -Descending)[0]
} else {
$release = ($releases | Where-Object { $_.tag_name -like $Version.Replace("x", "*") } | Select-Object -Property tag_name | Sort-Object -Descending)[0]
Expand Down

0 comments on commit 9f46db3

Please sign in to comment.