Skip to content

Commit 4305b11

Browse files
committed
Add logic to handle when coverage-reporter-version is empty, in addition to when it is null/unset.
1 parent ca5ca58 commit 4305b11

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ runs:
120120
cd ~/bin/
121121
122122
# Determine which version of coverage-reporter to download
123-
if [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
123+
if [ -z "$COVERAGE_REPORTER_VERSION" ] || [ "$COVERAGE_REPORTER_VERSION" == "latest" ]; then
124124
asset_path="latest/download"
125125
else
126126
asset_path="download/${COVERAGE_REPORTER_VERSION}"
@@ -167,7 +167,7 @@ runs:
167167
# Try to download the binary and checksum file
168168
New-Item -Path $env:HOME\bin -ItemType directory -Force
169169
Push-Location $env:HOME\bin
170-
if($env:COVERAGE_REPORTER_VERSION -eq "latest") {
170+
if ([string]::IsNullOrEmpty($env:COVERAGE_REPORTER_VERSION) -or $env:COVERAGE_REPORTER_VERSION -eq "latest") {
171171
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-windows.exe" -OutFile "coveralls.exe"
172172
Invoke-WebRequest -Uri "https://github.com/coverallsapp/coverage-reporter/releases/latest/download/coveralls-checksums.txt" -OutFile "sha256sums.txt"
173173
} else {

0 commit comments

Comments
 (0)