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

Trap exit code #1

Closed
riywo opened this issue Aug 30, 2022 · 1 comment
Closed

Trap exit code #1

riywo opened this issue Aug 30, 2022 · 1 comment

Comments

@riywo
Copy link
Contributor

riywo commented Aug 30, 2022

Exit code should be trapped instead of calling a function:

function exit_script() {
  local code=$?
  echo ::set-output name=exit-code::"$code"
}
trap exit_script EXIT
@riywo
Copy link
Contributor Author

riywo commented Sep 20, 2022

This function is not perfect as stdout is almost closed when running the handler function and gets Broken pipe.

@riywo riywo closed this as completed Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant