Following the update to builds, trigger conditions are now available in all actions. This means you can skip actions if they don’t fulfil certain requirements.
The following conditions have been added to the action settings:
- Always execute - the action will run every time the pipeline is executed
- Execute on change in repository - the action will be run only if Buddy detects a commit has been pushed to the pipeline’s branch. This is useful, for example, if you want to re-deploy the application in the same revision to the server and don’t need to compile it again
- Execute on change in repository paths - the action will be executed only on a change to specific folder in the repository
Trigger conditions are not available in deployment actions based on changesets (FTP, FTPS & SFTP).
Example use case
Let’s assume you have a Node.js project with a pipeline that tests your app and deploys it to one of the test servers on push. However, you don’t want the deploy to auto-execute if there are changes to the
/assets folder because you need to review them manually.
This can be resolved by adding Wait for approval to the pipeline:
Now, we need to apply the condition to the approval action so it’s only triggered if there are changes to the
/assets folder. Go to the action details and click Trigger condition & action name:
Select Execute on change in repository paths and enter the path below:
Once applied, Buddy will skip this action and automatically run the deploy – unless there are changes to the
You can learn more about optimizing your deployment practices in this guide.