Skip to content

Commit

Permalink
Should fail if error found
Browse files Browse the repository at this point in the history
  • Loading branch information
dgellow committed May 1, 2020
1 parent fe6d02c commit ac0e87d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
set -e

if [ -n "${GITHUB_WORKSPACE}" ]; then
Expand All @@ -7,5 +7,11 @@ fi

export REVIEWDOG_GITHUB_API_TOKEN="${INPUT_GITHUB_TOKEN}"

# 1. First check for warnings, should not exit with fail code when warnings found
# shellcheck disable=SC2086
dub lint --root="${INPUT_PATH:-PWD}" ${INPUT_DUB_FLAGS} -- ${INPUT_FLAGS} | reviewdog -efm="%f(%l:%c)[%tarn]: %m" -efm="%f(%l:%c)[%trror]: %m" -name="dscanner" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}"
dub lint --root="${INPUT_PATH:-PWD}" -- ${INPUT_FLAGS} | reviewdog -efm="%f(%l:%c)[%tarn]: %m" -name="dscanner" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}"

# 2. Then check for errors, if an error is found we should exit in error
set -euox pipefail # i.e: enable strict mode
# shellcheck disable=SC2086
dub lint --root="${INPUT_PATH:-PWD}" -- ${INPUT_FLAGS} | reviewdog -efm="%f(%l:%c)[%trror]: %m" -name="dscanner" -reporter="${INPUT_REPORTER}" -level="${INPUT_LEVEL}"

0 comments on commit ac0e87d

Please sign in to comment.