Skip to content

Commit

Permalink
Test action
Browse files Browse the repository at this point in the history
  • Loading branch information
sobolevn committed Dec 4, 2019
1 parent 2c673e8 commit 7ef21ae
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ elif [ "$INPUT_REPORTER" == 'github-pr-review' ] ||
export REVIEWDOG_GITHUB_API_TOKEN="$GITHUB_TOKEN"

output=$(dotenv-linter "$INPUT_OPTIONS")
echo "dotenv output: $output"
echo "$output" | reviewdog -efm='%f:%l %m' -reporter="$INPUT_REPORTER" -level=error
# `reviewdog` does not fail with any status code, so we have to get dirty:
status=$(test "$output" = ''; echo $?)
else
output="Invalid reporter specified: $INPUT_REPORTER"
output="Invalid action reporter specified: $INPUT_REPORTER"
status=1
fi

Expand All @@ -33,7 +34,8 @@ echo '================================='
echo

# Fail the build in case status code is not 0:
if [[ "$status" != 0 ]]; then
if [ "$status" != 0 ]; then
echo 'Failing with output:'
echo "$output"
echo "Process failed with the status code: $status"
exit "$status"
Expand Down

0 comments on commit 7ef21ae

Please sign in to comment.