First use of 'echo ::group::name' in script does not work properly

When running a bash script which uses grouping


echo Text
echo ::group::Git stuff
git clone ...
echo ::endgroup::

called from workflow as

- name: something
run: ./

output of git clone is displayed before other script output.


▶ Git stuff


Cloning into..
▶ Git stuff

runner v2.158.0

Hey @wipe2238 ,

Are you able to provide a link to the run where you are seeing this behavior? I have not been able to reproduce this issue. How frequently does this occur for you?


Some random jobs from last 12h (can’t find a way to view anything older):

Script which causes it (there’s more than one in repo, but they’re basically tweaked copypaste):

It seems that either something changed in last few days, or i’m just lucky recently. Previously it was rare to see first ::group working properly, now it’s a bit better but still present and easy to spot in my scenario (all workflows are schedule-only).

Hey @wipe2238 ,

Thanks so much for the report and detailed examples! I’ve been able to reproduce and find the root cause.

We have filed a bug for this issue so our team can work on a fix:

Items sent to stderr may be processed before stdout commands are processed, resulting in what you are seeing.

As for current workarounds:

You may want try piping git output from stderr to stdout.

It appears git clone outputs to the error stream:

Thanks again!