Command to early-exit the job and set check conclusion
See original GitHub issueDescribe the enhancement
Currently to skip the rest of steps during a job, an if
condition has to be added to all of steps or steps have to be moved to another job.
It’d be nice to have a command 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:
::exit::
It’d be also nice to set the conclusion of early-exited job:
::exit::failure
(equivalent to exit 1
)
or
::exit::neutral
(equivalent to exit 78
in Actions v1)
and other check conclusions.
This would help save build time for both GitHub and customers.
Additional information
Related StackOverflow and GitHub Community posts:
- How to fail a job in Github Actions?
- How to force to exit in Github Actions step
- How to write a GitHub Action with a neutral Check Run status
- How to perform an early clean exit of a job ?
- Early successful termination of job
- Github Action Skip Steps/Fall Through Syntax
Related issues:
Other CIs:
- CircleCI:
circleci-agent step halt
- Travis CI:
travis_terminate
- AppVeyor:
appveyor exit
(Linux) - Jenkins:
currentBuild.result
- GitLab CI:
exit 0
Issue Analytics
- State:
- Created 3 years ago
- Reactions:798
- Comments:37 (1 by maintainers)
Top Results From Across the Web
How to force to exit in Github Actions step
There is currently no way to exit a job arbitrarily, but there is a way to allow skipping subsequent steps if an earlier...
Read more >How to force to exit in Github Actions step
There is currently no way to exit a job arbitrarily, but there is a way to allow skipping subsequent steps if an earlier...
Read more >Python exit commands: quit(), exit(), sys.exit() and os._exit()
We can catch the exception to intercept early exits and perform cleanup activities; if uncaught, the interpreter exits as usual. quit() function ......
Read more >How to Use the PowerShell Exit Keyword to Terminate ...
The PowerShell exit keyword allows you to terminate scripts without closing your current console session. In this guide, we explain all the ...
Read more >How to Use the PowerShell Exit Command and Friends
Let's dig into this tutorial and first cover the exit keyword, one of the many reserved words in PowerShell. A reserved word is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This is useful to not repeat the same if statement many times, you can instead do an early exit
This is really useful and is quite needed!