GitLab CI 中是否存在日志分组?
GitHub Actions 使用
::group::
和 ::endgroup::
将日志封装成可折叠的段,这使得日志审核更加简单。
::group::{section title}
{logs that should be grouped}
::endgroup::
基于 https://docs.gitlab.com/ee/ci/jobs/#custom-collapsible-sections 解决方案是使用:
- 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 when collapsed'
- echo -e "\e[0Ksection_end:`date +%s`:my_first_section\r\e[0K"