From 0c7a1e8c080eaa48d3d35c20b1ec861cd88945cc Mon Sep 17 00:00:00 2001 From: Zimo Li <7163127+lzm0@users.noreply.github.com> Date: Mon, 24 Jun 2024 13:14:49 -0400 Subject: [PATCH] Add GitHub step summary messages for failed and successful runs --- action.yml | 2 +- run-scalafmt.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 5efc20e..4edec3d 100644 --- a/action.yml +++ b/action.yml @@ -17,7 +17,7 @@ runs: run: | version=$(perl -ne 'next unless /^\s*version\s*=\s*(\d+\.\d+\.\d+)/; print "$1"; last' .scalafmt.conf) if [ -z "$version" ]; then - echo "Failed to extract scalafmt version from .scalafmt.conf" + echo "Failed to extract scalafmt version from .scalafmt.conf" >> "$GITHUB_STEP_SUMMARY" exit 1 fi echo "scalafmt_version=$version" >> "$GITHUB_ENV" diff --git a/run-scalafmt.sh b/run-scalafmt.sh index 7979602..2fd3269 100755 --- a/run-scalafmt.sh +++ b/run-scalafmt.sh @@ -7,7 +7,7 @@ scalafmt --non-interactive $args > "$output" 2> "$warnings" result=$? cat "$output" cat "$warnings" >&2 -[ $result -eq 0 ] && exit +[ $result -eq 0 ] && echo "All files well-formatted ✨" >> "$GITHUB_STEP_SUMMARY" && exit report() { file="$1"