Toolkit: core.group is not working (`::group::{title}` and `::endgroup`). Document

Created on 5 Sep 2019  路  12Comments  路  Source: actions/toolkit

I'm currently using this feature to provide a 'clean' first view of each job/step. See https://github.com/1138-4EB/ghdl/runs/210613754#step:3:46. I think it'd be useful if this was documented Moreover, it'd be really useful to:

  • Allow nesting groups.
  • Make timing a group a built-in feature. Ideally, show the elapsed time in the same row as the arrows (first/title line of the group), not in the end.
  • Print the arrows (expand/collapse) in the margin, not in the body. And add vertical indentation lines.

I don't know if any of these features is available already through some other keyword.

Ref #98

changelog next release

Most helpful comment

That's correct, we're holding off releasing the toolkit till the fix is in the runner. I will update this issue so you can monitor here.

You are not forced to use the toolkit - it's a convenience. You can echo from scripts which is all the toolkit does.

:: is the official way going forward for all commands and group will work once our pools are updated in the next day or two. ## will work for quite some time back compat.

https://github.com/actions/toolkit/blob/master/docs/commands.md

echo ::group::my title .   # this is the official way
echo ::ungroup::

Nested groups are not in scope for GA. Grouping is a log web UI / service feature and I've created a feedback issue for that team.

All 12 comments

@bryanmacfarlane, related to https://github.com/actions/toolkit/issues/57#issuecomment-524463237, currently ::[ seems to be broken, but ##[ works: https://github.com/1138-4EB/rpm-ghdl/commit/5833e06119274d24f5806fc7b1457b8532275272/checks. Both of them worked ok until a few hours/days ago.

Core has functions but they are not working with runner. We are fixing.

https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L150

Core has functions but they are not working with runner.

Actually, master version of core is using :: (https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L32). But that was changed 8 days ago, and the latest release is from 19 days ago (https://github.com/actions/toolkit/blob/%40actions/core%401.1.0/packages/core/src/core.ts).

Therefore, the latest release of core works ok now because it still uses ##. As soon as a new release is published, it will be broken (as the ref above shows).

FTR, https://github.com/1138-4EB/actions/blob/master/src/main.ts#L10-L12 is an example of an action that uses this group feature of core. And this is an example log generated with it: https://github.com/1138-4EB/actions/commit/92a6da98ce69920b56e9d2b06b3a8b18be7ce88a/checks#step:2:8

We are fixing.

Is there any issue that I can subscribe to? As commented in #57, I'm actually using bash scripts to generate these commands/tags. I'd rather not be forced to have a complex TypeScript/JavaScript project just to be aware of when this is fixed.

BTW, is there anyone I should /cc in order to have some brief reply to the first comment in this issue? With the current repo/support structure, many Actions-related questions seem out of context and gathering very little attention...

That's correct, we're holding off releasing the toolkit till the fix is in the runner. I will update this issue so you can monitor here.

You are not forced to use the toolkit - it's a convenience. You can echo from scripts which is all the toolkit does.

:: is the official way going forward for all commands and group will work once our pools are updated in the next day or two. ## will work for quite some time back compat.

https://github.com/actions/toolkit/blob/master/docs/commands.md

echo ::group::my title .   # this is the official way
echo ::ungroup::

Nested groups are not in scope for GA. Grouping is a log web UI / service feature and I've created a feedback issue for that team.

@bryanmacfarlane, thanks a lot for clarifying, and for forwarding feedback to the team.

@1138-4EB , product suggested creating a discussion @ https://github.community and referencing this issue for the nested groups suggestion.

This is released and I updated the docs: https://github.com/actions/toolkit/blob/master/docs/commands.md#group-and-ungroup-log-lines

In the new docs, echo ::ungroup:: is shown, but the toolkit is still producing ::endgroup::, according to https://github.com/actions/toolkit/blob/master/packages/core/src/command.ts#L32 and https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L157. Which one is correct/up-to-date?

(sigh) typo in docs.

It's endgroup. I just updated the docs.

Thanks for catching that.

@bryanmacfarlane, this is still broken. Would you mind reopening this issue?

Please, find a reproducer in https://github.com/1138-4EB/actions/tree/test-groups and https://github.com/1138-4EB/actions/commit/f0d4c7dc00da0544f73463fb8b0db72cec5b1a01/checks?check_suite_id=276862247. Five different methods are used to create a group:

  • core.js: core.group feature of @actions/core
  • dots.js: plain javascript using ::
  • dots.sh: bash using ::
  • hash.js: plain javascript using ##
  • hash.sh: bash using ##

Each of the scripts is executed in a different step, and core.js is executed twice (once on the host and once in a docker container). For each execution, hexadecimal values (ASCII) are shown apart from the regular output.

Surprinsingly, although the sources of core.js use ::, at some point it is converted to ##. As a result, core.js produces the same output as hash.*, which looks correct. However, dots.* produce a broken output, even though these are the ones that are expected to be supported. Looking at the hex output, it can be seen that the output of core.js does indeed match the output of dots.* and not the one of hash.*.

js core
GroupName
0000000 3a 3a 67 72 6f 75 70 3a 3a 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 3a 3a 65 6e 64 67 72
0000040 6f 75 70 3a 3a 0a
0000046

js hash
GroupName
0000000 23 23 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 23 23 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

js dots
p]GroupName
0000000 3a 3a 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 3a 3a 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

bash hash
GroupName
0000000 23 23 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 23 23 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

bash dots
p]GroupName
0000000 3a 3a 5b 67 72 6f 75 70 5d 47 72 6f 75 70 4e 61
0000020 6d 65 0a 48 65 6c 6c 6f 0a 3a 3a 5b 65 6e 64 67
0000040 72 6f 75 70 5d 0a
0000046

EDIT

Oh, my bad. After reading this again and again, I found that I was using ::[group] instead of ::group::. Now all of them are converted automatically and shown properly. Sorry for bothering you.

@1138-4EB - NP. Thanks for confirming.

Was this page helpful?
0 / 5 - 0 ratings