From 1c88f70166aaf5e58da2ebaed448a823e357042e Mon Sep 17 00:00:00 2001 From: Mounika AWS Date: Mon, 15 Apr 2024 21:13:59 +0000 Subject: [PATCH] Set the output environment variable on failure --- main.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 9f8b212..6bbd726 100644 --- a/main.py +++ b/main.py @@ -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)=}") @@ -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) \ No newline at end of file + exit(1)