diff --git a/check.sh b/check.sh index 2e9f030..bca9027 100755 --- a/check.sh +++ b/check.sh @@ -36,12 +36,11 @@ fi if [ -n "$LINT" ]; then echo "::group::lint" - if cat "$LIST" | xargs -0 dhall lint --check; then - echo '::notice::Linting passed.' - else + if ! cat "$LIST" | xargs -0 "$GITHUB_ACTION_PATH/dhall-linter"; then echo '::error::Linting failed. Use `dhall lint` locally to fix the errors.' exit 1 fi + echo '::notice::Linting passed.' echo "::endgroup::" fi diff --git a/dhall-linter b/dhall-linter new file mode 100755 index 0000000..f1559a6 --- /dev/null +++ b/dhall-linter @@ -0,0 +1,9 @@ +#!/bin/sh +baseline=$(mktemp) +git status > "$baseline" || true +dhall lint "$@" +updated=$(mktemp) +git status > "$updated" || true +diff -u "$baseline" "$updated" || true +echo +git diff --exit-code -- "$@"