Skip to content

Commit

Permalink
fix: only end log group if lake command succeeds (#94)
Browse files Browse the repository at this point in the history
Ending the log group when a lake command fails prevented the log group
from expanding on a command failure.

Related to #92
  • Loading branch information
austinletson authored Aug 26, 2024
1 parent 50ba369 commit 56b85b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ to avoid `set-output-parameters` final step breaking log group expansion

- correct typo of in configuration step: "lake check-test failed" -> "lake check-lint failed"
- fix log group expansion in failing steps due to `set-output-parameters` step
and removing the end log group command when a step fails

## v1.0.1 - 2024-8-24

Expand Down
8 changes: 4 additions & 4 deletions scripts/lake_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ handle_exit() {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "build-status=FAILURE" >>"$GITHUB_OUTPUT"
echo "::error:: lake build failed"
else
echo "build-status=SUCCESS" >>"$GITHUB_OUTPUT"
# end log group and add a new line to improve readabiltiy
echo "::endgroup::"
echo
fi

# end log group and add a new line to improve readabiltiy
echo "::endgroup::"
echo
}

trap handle_exit EXIT
Expand Down
5 changes: 3 additions & 2 deletions scripts/lake_lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ handle_exit() {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "lint-status=FAILURE" >>"$GITHUB_OUTPUT"
echo "::error:: lake lint failed"
else
echo "lint-status=SUCCESS" >>"$GITHUB_OUTPUT"
echo "::endgroup::"
echo
fi
echo "::endgroup::"
echo
}

trap handle_exit EXIT
Expand Down
4 changes: 2 additions & 2 deletions scripts/lake_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ handle_exit() {
exit_status=$?
if [ $exit_status -ne 0 ]; then
echo "test-status=FAILURE" >>"$GITHUB_OUTPUT"
echo "::error:: lake test failed"
else
echo "test-status=SUCCESS" >>"$GITHUB_OUTPUT"
echo "::endgroup::"
fi
echo "::endgroup::"
echo
}

trap handle_exit EXIT
Expand Down

0 comments on commit 56b85b0

Please sign in to comment.