How to control which github commits to build for in CircleCI?
<p>I want to setup a CI such that it only reacts and builds when the git commits being reported by GitHub webhooks, contain changes for any content in a subfolder of my repo.</p>

<pre><code>myRepo
&gt; code1.js
&gt; workers &lt;-- run when this ... or anything under this changes
  &gt; worker1.js
</code></pre>

<p>For example, I want to setup a CircleCI build that can look at the commits and run a script to decide a <code>go? or no-go?</code> for builds based on the commit-changelog matching a regular expression that searches for <code>workers</code> in the changelog payload.</p>

<p>I just don't know where to hook in and how:</p>

<ol>
<li>should i setup my github webhook to be smarter somehow and discern if the changelog has anything mentioning the <code>workers</code> folder? This way my CI can stay dumb because the webhook makes the decision about when to push the commit-payload to the CI on its own.</li>
<li>should i hook in somewhere into CircleCI's yaml file somehow to discern if the changelog has anything mentioning the <code>workers</code> folder? if so where?</li>
</ol>

<p>I can write my own regex but i need to know where to inject/hook-in a script.</p>

<hr>

<p>Things I'm not asking for:</p>

<ol>
<li>I'm not asking for alternatives like git submodules</li>
<li>I do not want to split up into two separate repos</li>
</ol>