From 2eaee169140ec559bd556208f9f99cdfdf468da8 Mon Sep 17 00:00:00 2001 From: rindeal Date: Thu, 10 Oct 2024 18:34:36 +0000 Subject: [PATCH] Fixes bundle for action.yml (#249) Most important of the fixes is the first one, which sets `TRUNK_LAUNCHER_QUIET=false`. The launcher currently completely suppresses all output (including all errors), unless `TRUNK_LAUNCHER_QUIET` env var is set to `false`. ```bash if [[ ${TRUNK_LAUNCHER_QUIET} != false ]]; then exec 3>&1 4>&2 &>/dev/null fi ``` This prevents each and every one from debugging failed runs. Redirecting file descriptors like that also disables all `set -vx` output, resulting in a complete blackout and painful debugging. This PR will always enable launcher output, which is what I prefer, however if you don't like that, it may be changed, so that it's set only if `RUNNER_DEBUG == 1`. Also, you can migrate to `actions/download-artifact@v4` and rewrite this step: https://github.com/trunk-io/trunk-action/blob/03cb46f406176a84f390fb565960606c2bd0b8b3/action.yaml#L355-L378 --------- Co-authored-by: Eli Schleifer <1265982+EliSchleifer@users.noreply.github.com> --- action.yaml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/action.yaml b/action.yaml index c0aaa0d8..99d8eb90 100644 --- a/action.yaml +++ b/action.yaml @@ -127,6 +127,7 @@ runs: run: | cat >>$GITHUB_ENV <>$GITHUB_ENV fi - name: Detect setup strategy shell: bash run: | - if [ -e .trunk/setup-ci ]; then + if [[ -e .trunk/setup-ci ]]; then echo "INPUT_SETUP_DEPS=true" >>$GITHUB_ENV else mkdir -p .trunk @@ -336,7 +337,7 @@ runs: shell: bash run: | echo "::group::.trunk/logs/cli.log" - if [ -f .trunk/logs/cli.log ]; then + if [[ -f .trunk/logs/cli.log ]]; then cat .trunk/logs/cli.log else echo ".trunk/logs/cli.log doesn't exist" @@ -344,7 +345,7 @@ runs: echo "::endgroup::" echo "::group::.trunk/logs/daemon.log" - if [ -f .trunk/logs/daemon.log ]; then + if [[ -f .trunk/logs/daemon.log ]]; then cat .trunk/logs/daemon.log else echo ".trunk/logs/daemon.log doesn't exist" @@ -367,7 +368,7 @@ runs: - name: Download annotations artifact if: inputs.post-annotations == 'true' - uses: actions/github-script@v6 + uses: actions/github-script@v7 with: # TODO(chris): We can't use the official download artifact action yet: https://github.com/actions/download-artifact/issues/172 script: |