# How to conditionaly run set of N commands vs. set of Y commands based on files changed in branch?

**URL:** <https://discuss.circleci.com/t/how-to-conditionaly-run-set-of-n-commands-vs-set-of-y-commands-based-on-files-changed-in-branch/35272>\
**Category:** Build Environment\
**Created:** [April 3, 2020, 10:58pm UTC](https://discuss.circleci.com/t/how-to-conditionaly-run-set-of-n-commands-vs-set-of-y-commands-based-on-files-changed-in-branch/35272 "2020-04-03T22:58:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![deanorderly](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/deanorderly/32/25132_2.png) [@deanorderly](https://discuss.circleci.com/u/deanorderly)\
**Post date:** [April 3, 2020, 10:58pm UTC](https://discuss.circleci.com/t/how-to-conditionaly-run-set-of-n-commands-vs-set-of-y-commands-based-on-files-changed-in-branch/35272/1 "2020-04-03T22:58:43Z")

</div>

Currently, we follow a policy of master is never broken. 1. developers can’t even push to master on github for our repo and 2. they must submit a submit\_{name}/{work} branch which circlci merges.

The process(for more detail if you want it is [https://stackoverflow.com/questions/60566598/can-circleci-prevent-bad-commits-from-landing-on-master-like-jenkins-can/61017261#61017261](https://stackoverflow.com/questions/60566598/can-circleci-prevent-bad-commits-from-landing-on-master-like-jenkins-can/61017261#61017261))

Now, there is a data-science, java, and python directory.

If java any files in java dir are changed we want to run that process. If NOT, we want to run a simpler process of simply checkout, merge in master to local circleCI and if not fail, then checkout master, merge into that and push to master from circleCI.

Is there a way to have a forked path like this in the .circleci/config.yml file?

thanks,  
Dean
