Skip to content

Commit 81ebf11

Browse files
committed
Account for group nesting level, only emit Github groups for level 0
1 parent ad2652f commit 81ebf11

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

ci-support.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,21 +56,24 @@ if [[ "$GITLAB_CI" = "true" ]] && [[ "$CI_DISPOSABLE_ENVIRONMENT" = "true" ]];
5656
fi
5757

5858

59+
GROUP_NEST_LEVEL=0
5960
begin_output_group()
6061
{
61-
if [[ $GITHUB_ACTIONS == "true" ]]; then
62+
if [[ $GITHUB_ACTIONS == "true" ]] && [[ $GROUP_NEST_LEVEL == 0 ]]; then
6263
echo "::group::$1"
6364
else
6465
echo "--------------------------------------------------------------"
6566
echo "BEGIN $1"
6667
echo "--------------------------------------------------------------"
6768
fi
69+
GROUP_NEST_LEVEL=$((GROUP_NEST_LEVEL + 1))
6870
}
6971

7072

7173
end_output_group()
7274
{
73-
if [[ $GITHUB_ACTIONS == "true" ]]; then
75+
GROUP_NEST_LEVEL=$((GROUP_NEST_LEVEL - 1))
76+
if [[ $GITHUB_ACTIONS == "true" ]] && [[ $GROUP_NEST_LEVEL == 0 ]]; then
7477
echo "::endgroup::$1"
7578
else
7679
echo "--------------------------------------------------------------"

0 commit comments

Comments
 (0)