mirror of
https://github.com/mtkennerly/dunamai-action.git
synced 2025-06-20 06:08:03 +00:00
#2: Fix error reporting
This commit is contained in:
parent
66bb6c8842
commit
c1b34a8a25
3 changed files with 10 additions and 32 deletions
30
.github/workflows/errors.yaml
vendored
30
.github/workflows/errors.yaml
vendored
|
@ -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
|
|
8
.github/workflows/main.yaml
vendored
8
.github/workflows/main.yaml
vendored
|
@ -23,6 +23,7 @@ jobs:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
name: full invocation
|
||||||
id: full
|
id: full
|
||||||
with:
|
with:
|
||||||
install: '1.13.2'
|
install: '1.13.2'
|
||||||
|
@ -36,5 +37,12 @@ jobs:
|
||||||
- run: echo ${{ steps.full.outputs.version }} from outputs
|
- run: echo ${{ steps.full.outputs.version }} from outputs
|
||||||
|
|
||||||
- uses: ./
|
- uses: ./
|
||||||
|
name: minimal invocation
|
||||||
id: minimal
|
id: minimal
|
||||||
- run: echo ${{ steps.minimal.outputs.version }} from outputs
|
- run: echo ${{ steps.minimal.outputs.version }} from outputs
|
||||||
|
|
||||||
|
- uses: ./
|
||||||
|
name: invalid VCS
|
||||||
|
continue-on-error: true
|
||||||
|
with:
|
||||||
|
command: dunamai from incorrect
|
||||||
|
|
|
@ -25,11 +25,11 @@ def set_failed(error: Exception) -> None:
|
||||||
|
|
||||||
stdout = getattr(error, "stdout", None)
|
stdout = getattr(error, "stdout", None)
|
||||||
if stdout is not None:
|
if stdout is not None:
|
||||||
print("stdout: {}".format(stdout))
|
print("stdout: {}".format(stdout.decode("utf-8").strip()))
|
||||||
|
|
||||||
stderr = getattr(error, "stderr", None)
|
stderr = getattr(error, "stderr", None)
|
||||||
if stderr is not None:
|
if stderr is not None:
|
||||||
print("stderr: {}".format(stdout))
|
print("stderr: {}".format(stdout.decode("utf-8").strip()))
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue