mirror of
https://github.com/cachix/install-nix-action.git
synced 2024-11-22 08:30:51 +00:00
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.)
This commit is contained in:
parent
451e611838
commit
6c5ba55bfd
1 changed files with 6 additions and 0 deletions
|
@ -6,6 +6,9 @@ if type -p nix &>/dev/null ; then
|
||||||
exit
|
exit
|
||||||
fi
|
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
|
# Create a temporary workdir
|
||||||
workdir=$(mktemp -d)
|
workdir=$(mktemp -d)
|
||||||
trap 'rm -rf "$workdir"' EXIT
|
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
|
if [[ $INPUT_NIX_PATH != "" ]]; then
|
||||||
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
echo "NIX_PATH=${INPUT_NIX_PATH}" >> "$GITHUB_ENV"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Close the log message group which was opened above
|
||||||
|
echo "::endgroup::"
|
||||||
|
|
Loading…
Reference in a new issue