I’m pretty new to CircleCI and for some reason I just can’t wrap my head around how to call a webhook only on successful build of the master branch with CircleCI 2.0. Currently I am using a script to verify that the PHPUnit test passed or failed then I call the forge webhook upon success. This works fine but doesn’t prevent the deployment hook from happening if it’s a branch other than master.
- run: name: Run PHPUnit tests and deploy command: bash .circleci/deploy.sh
What I would like to do is something like this.
- run: name: Run PHPUnit tests command: ./vendor/bin/phpunit
then IF the build is successful AND the branch is master then perform a wget/curl on the webhook url. I am sure this is something simple. Thanks for any answers on this.