From c1b34a8a258582b11aaa533ee0ebef96f4d13295 Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Tue, 28 Mar 2023 23:21:23 +0800 Subject: [PATCH] #2: Fix error reporting --- .github/workflows/errors.yaml | 30 ------------------------------ .github/workflows/main.yaml | 8 ++++++++ action.py | 4 ++-- 3 files changed, 10 insertions(+), 32 deletions(-) delete mode 100644 .github/workflows/errors.yaml diff --git a/.github/workflows/errors.yaml b/.github/workflows/errors.yaml deleted file mode 100644 index 8790ad4..0000000 --- a/.github/workflows/errors.yaml +++ /dev/null @@ -1,30 +0,0 @@ -on: - - workflow_dispatch - -name: Errors - -jobs: - test: - strategy: - matrix: - os: - - ubuntu-latest - - windows-latest - - macos-latest - runs-on: ${{ matrix.os }} - steps: - - uses: actions/setup-python@v4 - with: - python-version: '3.7' - - uses: ./ - name: before checkout - continue-on-error: true - - uses: actions/checkout@v3 - with: - # This is necessary so that we have the tags. - fetch-depth: 0 - - uses: ./ - name: invalid VCS - continue-on-error: true - with: - command: dunamai from incorrect diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index c8997e5..e57dd43 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -23,6 +23,7 @@ jobs: fetch-depth: 0 - uses: ./ + name: full invocation id: full with: install: '1.13.2' @@ -36,5 +37,12 @@ jobs: - run: echo ${{ steps.full.outputs.version }} from outputs - uses: ./ + name: minimal invocation id: minimal - run: echo ${{ steps.minimal.outputs.version }} from outputs + + - uses: ./ + name: invalid VCS + continue-on-error: true + with: + command: dunamai from incorrect diff --git a/action.py b/action.py index 42e28cf..93ec815 100644 --- a/action.py +++ b/action.py @@ -25,11 +25,11 @@ def set_failed(error: Exception) -> None: stdout = getattr(error, "stdout", None) if stdout is not None: - print("stdout: {}".format(stdout)) + print("stdout: {}".format(stdout.decode("utf-8").strip())) stderr = getattr(error, "stderr", None) if stderr is not None: - print("stderr: {}".format(stdout)) + print("stderr: {}".format(stdout.decode("utf-8").strip())) def main() -> None: