Skip to content

Commit

Permalink
Set the output environment variable on failure (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mponaws authored Apr 15, 2024
1 parent 6408724 commit 666e9c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,10 @@ def execute_command(command):
err.returncode, err.with_traceback, err.output
)
)

if err.returncode == 2:
return err.output

raise
except Exception as err:
print(f"Unexpected {err=}, {type(err)=}")
Expand All @@ -215,4 +219,4 @@ def set_github_action_output(output_name, output_value):
except Exception as e:
traceback.print_exc()
print(f"ERROR: Unexpected error occurred. {str(e)}", file=sys.stderr)
exit(1)
exit(1)

0 comments on commit 666e9c2

Please sign in to comment.