How to implement an "after success" action? #27141
-
I have the following action, named “Node CI”, which runs on every push:
After all build matrixes are successful (as in, successful build on both node 8 and 13), if the branch is master, I’d like to run a release process, which would consist of basically
How can I make the “Release” workflow run only after all “Node CI” are finished and successful (including all matrixes)? |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
Put them both in the same workflow, and add:
Release job only gets triggered if we are in master branch and “build” job is successful and complete, including the whole matrix. |
Beta Was this translation helpful? Give feedback.
-
How would one implement an “else” script, such as using if for success, and something else for failure (what I’m trying to do) |
Beta Was this translation helpful? Give feedback.
-
Any solution to the if/else problem? |
Beta Was this translation helpful? Give feedback.
-
Take a look at the Workflow Conclusion Action. https://github.com/marketplace/actions/workflow-conclusion-action The action creates an environment variable that you can use check the status of the other jobs. Here’s the example from their README:
Notice that the last step only runs if the other jobs failed. |
Beta Was this translation helpful? Give feedback.
-
This is how I implemented if/else with slack notifications for my failed builds:
|
Beta Was this translation helpful? Give feedback.
-
This is a great solution. You can also do it with
|
Beta Was this translation helpful? Give feedback.
Put them both in the same workflow, and add:
Release job only gets triggered if we are in master branch and “build” job is successful and complete, including the whole matrix.