From 6834c83adb490bcc21cd6cc7b3baa0528d63f755 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 23 Jul 2021 19:23:04 +0200 Subject: [PATCH] only use a group when we're in a multi-module repo --- action.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/action.yml b/action.yml index cf071f1..93d3c70 100644 --- a/action.yml +++ b/action.yml @@ -12,13 +12,15 @@ runs: - shell: bash run: | status=0 - for dir in $(find . \( -name vendor -o -name '[._].*' -o -name node_modules \) -prune -o -name go.mod -print | sed 's:/go.mod$::'); do + dirs=$(find . \( -name vendor -o -name '[._].*' -o -name node_modules \) -prune -o -name go.mod -print | sed 's:/go.mod$::') + len=${#dirs[@]} + for dir in $dirs; do pushd $dir > /dev/null - echo "::group::$dir" + if [[ $len > 1 ]]; then echo "::group::$dir"; fi ( ${{ inputs.run }} ) - echo "::endgroup::" + if [[ $len > 1 ]]; then echo "::endgroup::"; fi s=$? if [[ $s != 0 ]]; then status=$s; fi popd > /dev/null