-
Notifications
You must be signed in to change notification settings - Fork 865
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
Alllow Actions to have post-run steps that run even after an earlier failure #987
Comments
i'm looking for something similar for Composite Action, i'd like to have Java try/finally logic that i can clean up resources in post-run (aka, finally) |
This should work already if you provide
|
Closing since I think this is answered, will re-open if I'm missing something. |
@hross I'm not sure this works as you want two separate post steps - one that always runs and one that only runs on success. Does the post step have a way to find out whether the run was successful? |
@robtaylor I think you can use the step |
According to actions/runner#987, this should run the post step (cleanup.js) also when a workflow fails. Probably most important on self-hosted runners that are not ephemeral, to terminate SSH agents from failed jobs as well.
According to actions/runner#987, this should run the post step (cleanup.js) also when a workflow fails. Probably most important on self-hosted runners that are not ephemeral, to terminate SSH agents from failed jobs as well.
Describe the enhancement
For some classes of Action, it would be helpful if the post run Step would be run even if an earlier Step has failed.
The concrete use case I have in mind here is for action/cache - For many classes of cache (e.g. ccache, package installation), you still want to store the cache, even if failure has occurred. This would allow subsequent runs of the step with the issue to fail or success more quickly.
Code Snippet
A possible design here is to add a
post-always:
key.e.g.
This could be implemented in the runner codebase by adding an
Always
getter toIStep
and behaving appropriately inStepsRunner
in the case of runner shutdown.NOTE: if the feature request has been agreed upon then the assignee will create an ADR. See docs/adrs/README.md
The text was updated successfully, but these errors were encountered: