Skip to content

Commit 6c5ba55

Browse files
committed
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.)
1 parent 451e611 commit 6c5ba55

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

install-nix.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ if type -p nix &>/dev/null ; then
66
exit
77
fi
88

9+
# GitHub command to put the following log messages into a group which is collapsed by default
10+
echo "::group::Installing Nix"
11+
912
# Create a temporary workdir
1013
workdir=$(mktemp -d)
1114
trap 'rm -rf "$workdir"' EXIT
@@ -84,3 +87,6 @@ echo "/nix/var/nix/profiles/per-user/$USER/profile/bin" >> "$GITHUB_PATH"
8487
if [[ $INPUT_NIX_PATH != "" ]]; then
8588
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
8689
fi
90+
91+
# Close the log message group which was opened above
92+
echo "::endgroup::"

0 commit comments

Comments
 (0)