Note when using the suggested method by @oppianmatt, the following does not work (using dependencies section as example)
dependencies:
override:
- [ $CIRCLE_BRANCH = 'master' ] && run_something
But the following does work
dependencies:
override:
- if [ $CIRCLE_BRANCH = 'master' ]; then run_something; fi
Unfortunately these steps will still pollute the build output, but at least you can control the execution of commands for a specific branch.
I would like to see CircleCI support the following
dependencies:
branch: master
override:
- run_something