Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set the output environment variable on failure #7

Merged
merged 1 commit into from
Apr 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)