Skip to content

Commit

Permalink
Add GitHub step summary messages for failed and successful runs
Browse files Browse the repository at this point in the history
  • Loading branch information
lzm0 committed Jun 24, 2024
1 parent f18aabe commit 0c7a1e8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion run-scalafmt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 0c7a1e8

Please # to comment.