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

feat: expose task's exit code to env var 'DEFER_EXIT_CODE' #1673

Closed
wants to merge 10 commits into from

Conversation

dorimon-1
Copy link
Contributor

Issue: #1484

Exposes environment variable DEFER_EXIT_CODE once a task is finished, to allow you to use it in defer statements.
In case there was an error (exit code != 0), it wont be overridden by a successful task, but it will be overridden when a different task fails with a different code.

Update documentation for DEFER_EXIT_CODE
@dorimon-1 dorimon-1 marked this pull request as ready for review May 27, 2024 18:56
Revert "remove package-lock.json"

This reverts commit 2409637.

remove package-lock
@dorimon-1 dorimon-1 requested a review from pd93 June 9, 2024 16:48
Copy link
Member

@pd93 pd93 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@pd93 pd93 requested a review from andreynering June 9, 2024 17:17
Copy link
Member

@andreynering andreynering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @dorimon-1. Thanks for your pull request, it is much appreciated!

I'm requesting changes EXIT_CODE should be a regular variable and not an environment variable. This would make it consistent with the other special variables.

@andreynering andreynering linked an issue Jun 14, 2024 that may be closed by this pull request
@dorimon-1
Copy link
Contributor Author

Hi @dorimon-1. Thanks for your pull request, it is much appreciated!

I'm requesting changes EXIT_CODE should be a regular variable and not an environment variable. This would make it consistent with the other special variables.

Hi, thanks for your comment.
I have made those changes, hope you see them fit

@dorimon-1 dorimon-1 requested a review from andreynering June 14, 2024 07:23
@danilobuerger
Copy link
Contributor

@andreynering @pd93 any chance to get this merged?

@dorimon-1
Copy link
Contributor Author

dorimon-1 commented Jul 9, 2024

Also fixed conflicts and updated docs with the current standard

@vmaerten vmaerten self-requested a review July 9, 2024 16:00
@vmaerten vmaerten self-requested a review July 9, 2024 18:27
@andreynering
Copy link
Member

Hey @dorimon-1!

There were further changes required for this to work as desired. I did those changes on #1762 and just merged it.

Basically, we neede to make that variable as scoped as possible, i.e., available only to that specific defer: command and not globally.

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

Successfully merging this pull request may close these issues.

Allow defer to know if the task succeded or failed
5 participants