From 0a0addedd73e7e4139d52a6d8db4258763e0f1f3 Mon Sep 17 00:00:00 2001 From: Tim 'mithro' Ansell Date: Tue, 14 Dec 2021 13:17:36 -0800 Subject: [PATCH] Adding grouping in GitHub Actions output. Signed-off-by: Tim 'mithro' Ansell --- .github/scripts/generate-html.sh | 12 ++++++++---- .github/scripts/push-html.sh | 14 ++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.github/scripts/generate-html.sh b/.github/scripts/generate-html.sh index 4aa9859d..da57f44e 100755 --- a/.github/scripts/generate-html.sh +++ b/.github/scripts/generate-html.sh @@ -13,10 +13,11 @@ PYTHONHASHSEED=0 PRJXRAY_INFO_REVISION=$(grep "prjxray/commit" Info.md | sed -e's-.*/prjxray/commit/--' -e's/\([0-9a-fA-F]*\).*$/\1/') echo -echo "Project X-Ray Database Revision $(git describe --long --tags --always)" +echo "::group::Project X-Ray Database Revision $(git describe --long --tags --always)" echo "--------------------------------------------" git log -1 echo "--------------------------------------------" +echo "::endgroup::" echo # Remove any pre-existing html output. @@ -55,7 +56,7 @@ fi # Reset to the right revision git reset --hard $PRJXRAY_INFO_REVISION echo - echo "Project X-Ray Revision $(git describe --long --tags --always)" + echo "::group::Project X-Ray Revision $(git describe --long --tags --always)" echo "--------------------------------------------" echo "Info says version should be $(git describe --long --tags --always $PRJXRAY_INFO_REVISION) ($PRJXRAY_INFO_REVISION)" echo "--------------------------------------------" @@ -66,6 +67,7 @@ fi echo rm -rf database ln -s $DBDIR database + echo "::endgroup::" ) # Generate the HTML for each device we have a settings file for. @@ -75,7 +77,7 @@ for SETTINGS in $(ls $TMPDIR/prjxray/settings/*.sh | grep '7.sh$'); do export PYTHONPATH=$PYTHONPATH:$TMPDIR/prjxray echo - echo "Generating for $DEVICE" + echo "::group::Generating for $DEVICE" echo "--------------------------------------------" echo "settings.sh $(sha256sum $SETTINGS)" cat $SETTINGS @@ -103,6 +105,7 @@ for SETTINGS in $(ls $TMPDIR/prjxray/settings/*.sh | grep '7.sh$'); do echo "--------------------------------------------" done fi + echo "::endgroup::" done @@ -119,9 +122,10 @@ python3 -m markdown \ # Output a summary of the generated stuff ( echo - echo "HTML Results" + echo "::group::HTML Results" echo "--------------------------------------------" sha256sum $(find html -type f | sort) echo "--------------------------------------------" + echo "::endgroup::" echo ) diff --git a/.github/scripts/push-html.sh b/.github/scripts/push-html.sh index ea1849b9..3781732b 100755 --- a/.github/scripts/push-html.sh +++ b/.github/scripts/push-html.sh @@ -25,7 +25,7 @@ TMPDIR=$(mktemp -d) # Clone the destination echo - echo "Cloning GitHub pages" + echo "::group::Cloning GitHub pages" echo "--------------------------------------------" ssh-add -l ssh -v github.com || true @@ -37,9 +37,10 @@ TMPDIR=$(mktemp -d) find -type f | grep -v .git | sort ) echo "--------------------------------------------" + echo "::endgroup::" echo - echo "Updating html" + echo "::group::Updating html" echo "--------------------------------------------" rm -rf html/* cp -a $SRCDIR/html/* html/ @@ -48,11 +49,12 @@ TMPDIR=$(mktemp -d) git add --all . ) echo "--------------------------------------------" + echo "::endgroup::" ( cd html echo - echo "Committing" + echo "::group::Committing" echo "--------------------------------------------" git status echo "--------------------------------------------" @@ -69,11 +71,15 @@ TMPDIR=$(mktemp -d) -m "" \ -m "$CURRENT_MESSAGE" fi + echo "--------------------------------------------" + echo "::endgroup::" + echo - echo "Pushing" + echo "::group::Pushing" echo "--------------------------------------------" git push origin echo "--------------------------------------------" + echo "::endgroup::" ) )