From 81ebf1188f01cc1ac4223e92b087630e5d4cbf77 Mon Sep 17 00:00:00 2001 From: Andreas Kloeckner Date: Wed, 5 Mar 2025 10:45:14 -0600 Subject: [PATCH] Account for group nesting level, only emit Github groups for level 0 --- ci-support.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ci-support.sh b/ci-support.sh index 53f9ca3..a4007f4 100644 --- a/ci-support.sh +++ b/ci-support.sh @@ -56,21 +56,24 @@ if [[ "$GITLAB_CI" = "true" ]] && [[ "$CI_DISPOSABLE_ENVIRONMENT" = "true" ]]; fi +GROUP_NEST_LEVEL=0 begin_output_group() { - if [[ $GITHUB_ACTIONS == "true" ]]; then + if [[ $GITHUB_ACTIONS == "true" ]] && [[ $GROUP_NEST_LEVEL == 0 ]]; then echo "::group::$1" else echo "--------------------------------------------------------------" echo "BEGIN $1" echo "--------------------------------------------------------------" fi + GROUP_NEST_LEVEL=$((GROUP_NEST_LEVEL + 1)) } end_output_group() { - if [[ $GITHUB_ACTIONS == "true" ]]; then + GROUP_NEST_LEVEL=$((GROUP_NEST_LEVEL - 1)) + if [[ $GITHUB_ACTIONS == "true" ]] && [[ $GROUP_NEST_LEVEL == 0 ]]; then echo "::endgroup::$1" else echo "--------------------------------------------------------------" -- GitLab