Skip to content

Commit a4761b6

Browse files
pks-tgitster
authored andcommitted
ci: reorder definitions for grouping functions
We define a set of grouping functions that are used to group together output in our CI, where these groups then end up as collapsible sections in the respective pipeline platform. The way these functions are defined is not easily extensible though as we have an up front check for the CI _not_ being GitHub Actions, where we define the non-stub logic in the else branch. Reorder the conditional branches such that we explicitly handle GitHub Actions. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 43c8a30 commit a4761b6

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

ci/lib.sh

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
# Library of functions shared by all CI scripts
22

3-
if test true != "$GITHUB_ACTIONS"
3+
if test true = "$GITHUB_ACTIONS"
44
then
5-
begin_group () { :; }
6-
end_group () { :; }
7-
8-
group () {
9-
shift
10-
"$@"
11-
}
12-
set -x
13-
else
145
begin_group () {
156
need_to_end_group=t
167
echo "::group::$1" >&2
@@ -42,6 +33,15 @@ else
4233
}
4334

4435
begin_group "CI setup"
36+
else
37+
begin_group () { :; }
38+
end_group () { :; }
39+
40+
group () {
41+
shift
42+
"$@"
43+
}
44+
set -x
4545
fi
4646

4747
# Set 'exit on error' for all CI scripts to let the caller know that

0 commit comments

Comments
 (0)