From 6c5ba55bfdc791cfad61ac72e473340c1c3ac992 Mon Sep 17 00:00:00 2001 From: Sergey Vlasov Date: Mon, 27 Jun 2022 00:23:14 +0300 Subject: [PATCH] install-nix.sh: Collapse log messages The Nix installer produces a significant number of log messages, but usually those messages are not really interesting. Group those messages under a header, so that GitHub will keep them collapsed by default. (Usually log messages are collapsed under the step title anyway, but if this action is uses inside another composite action, there is no separate step title, therefore the whole Nix installer output is immediately visible when the log section for the outer composite action is expanded. Adding the group header fixes this problem.) --- install-nix.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/install-nix.sh b/install-nix.sh index ad305b2..f462e9d 100755 --- a/install-nix.sh +++ b/install-nix.sh @@ -6,6 +6,9 @@ if type -p nix &>/dev/null ; then exit fi +# GitHub command to put the following log messages into a group which is collapsed by default +echo "::group::Installing Nix" + # Create a temporary workdir workdir=$(mktemp -d) trap 'rm -rf "$workdir"' EXIT @@ -84,3 +87,6 @@ echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH" if [[ $INPUT_NIX_PATH != "" ]]; then echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV" fi + +# Close the log message group which was opened above +echo "::endgroup::"