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

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

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?