Skip to content

Commit

Permalink
Add logic to handle when coverage-reporter-version is empty, in addit…
Browse files Browse the repository at this point in the history
…ion to when it is null/unset.
  • Loading branch information
afinetooth committed Oct 15, 2024
1 parent ca5ca58 commit 4305b11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ runs:
cd ~/bin/
# Determine which version of coverage-reporter to download
if [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
if [ -z "$COVERAGE_REPORTER_VERSION" ] || [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
asset_path="latest/download"
else
asset_path="download/${COVERAGE_REPORTER_VERSION}"
Expand Down Expand Up @@ -167,7 +167,7 @@ runs:
# Try to download the binary and checksum file
New-Item -Path $env:HOME\bin -ItemType directory -Force
Push-Location $env:HOME\bin
if($env:COVERAGE_REPORTER_VERSION -eq "latest") {
if ([string]::IsNullOrEmpty($env:COVERAGE_REPORTER_VERSION) -or $env:COVERAGE_REPORTER_VERSION -eq "latest") {
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe" -OutFile "coveralls.exe"
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt" -OutFile "sha256sums.txt"
} else {
Expand Down

0 comments on commit 4305b11

Please sign in to comment.