Replies: 6 comments 12 replies
-
Currently, https://github.com/actions/toolkit/tree/main/packages/core#exit-codes says:
The docs at https://docs.github.com/en/actions/creating-actions/setting-exit-codes-for-actions only mentions One possible workaround would be to update the check run after it fails (See https://docs.github.com/en/rest/checks/runs#update-a-check-run). Unfortunately, that can't be done with a regular user token, only with GitHub Apps. |
Beta Was this translation helpful? Give feedback.
-
This is something that has come for me a lot when working on workflows, would REALLY love to see it implemented |
Beta Was this translation helpful? Give feedback.
-
If you're looking for a solution, at least to cancel:
Results in:
|
Beta Was this translation helpful? Give feedback.
-
It is a must to avoid repetitive if conditions on all the following steps and improve readability! |
Beta Was this translation helpful? Give feedback.
-
👋 Chiming in from the Actions product team. I may roll this request up into a general backlog item for conditional operators. I think this is a similar ask. This is something that may be considered for this year. I will report back in October after planning to inform this group of the outcome. |
Beta Was this translation helpful? Give feedback.
-
Has this feature been released? I can't find a way to avoid the "if" in each of the steps of a GHA to make the job exit as soon as a step determined there is nothing to do. Is there a planned release for this feature? (Maybe @Steve-Glass) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Product Feedback
Body
Currently, to skip the rest of the steps during a job, an
if
condition has to be added to all of the steps or steps have to be moved to another job.It'd be nice to have a command or a step to early-exit (premature, prematurely, graceful, gracefully) (end, finish, terminate, termination, stop, halt, skip, cancel, discontinue, fail) the job during a step without failing the job:
It'd also be nice to set the conclusion of the early-exited job:
(equivalent to
exit 1
) or(equivalent to
exit 78
in Actions v1) and other check conclusions.This would help save build time for both GitHub and customers.
Related StackOverflow and GitHub Community posts
Related issues
setNeutral
method been removed? toolkit#146Same functionality in other CIs
circleci-agent step halt
travis_terminate
appveyor exit
(Linux)currentBuild.result
exit 0
Originally posted by @ylemkimon in actions/runner#662 (comment)
This issue has received A LOT of upvotes (800+ at the time of writing) on the actions/runner repository but has since been closed with a request to redirect this feedback to this forum which is what this newly made discussion is meant to achieve:
actions/runner#662
Beta Was this translation helpful? Give feedback.
All reactions