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

DOC: Is return necessary after setFailed? #679

Closed
pllim opened this issue Dec 22, 2020 · 1 comment
Closed

DOC: Is return necessary after setFailed? #679

pllim opened this issue Dec 22, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@pllim
Copy link

pllim commented Dec 22, 2020

Hello. If I decide to use core.setFailed(...) but there are code after that runs if it did not fail, do I need to also add a return or does setFailed automatically terminates the Action? It is not clear from the README.

Example logic:

import * as core from "@actions/core";

async function run() {
    if (condition1) {
        core.setFailed("You should not have done that");
        // Do I need return; here?
    }
   do_stuff_on_success();
}
@pllim pllim added the enhancement New feature or request label Dec 22, 2020
@thboop
Copy link
Collaborator

thboop commented Apr 30, 2021

Hey @pllim thanks for the information! setFailed does not automatically terminate the process, you need to do that manually. You can do that via a return, or following an example like our typescript actions

I think the docs here are good now, but if you have an idea for how to improve them, please submit a pr!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants