Allow marking CI sections as collapsed at the end of the section in section_end
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
You can mark a Gitlab CI section as collapsed by default:
job1:
script:
- echo -e "\e[0Ksection_start:`date +%s`:my_first_section[collapsed=true]\r\e[0KHeader of the 1st collapsible section"
- echo 'this line should be hidden automatically after loading the job log'
- echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"
However this requires you to know in advance if you want it to be collapsed. A very obvious use case for sections is collapsing the output of successful command, but this requires you to run the command first.
My current workaround is to run the command, capturing all output, and then print the section stuff and its output. But that kind of sucks; it would be better if you could just use [collapsed=true] on the section_end line.
Here is the code where options are only considered in section_start.
Edited by 🤖 GitLab Bot 🤖