title: Problem with using nx affected for Nx Monorepro in Azure DevOps
body: <p>We have two Angular applications with their libraries in our Nx monorepro. The apps are build on our Azure DevOps pipeline. We started off by always running tests and builds for everything all the time which worked, but is way too slow.</p>
  <p>We now wanted to make use of the caching and turned to only test and build affected parts.
  But we are facing the issue that nothing is build/deployed when a PR is merged into master.</p>
  <p>My guess is that something within our branch and head configuration is not correct.</p>
  <p><strong>The setup</strong></p>
  <p>The cache directory is a shared directory across all our build agents. We created a custom runner where that directory is being used as the cacheDirectory.</p>
  <p>The scripts we tried running were:</p>
  <pre><code>nx affected:build --prod --runner=ci --parallel --verbose --base=origin/master
  nx affected:test --ci --codeCoverage --runner=ci --parallel --base=origin/master
  </code></pre>
  <pre><code>nx affected:build --prod --runner=ci --parallel --verbose --base=remotes/origin/master~1
  nx affected:test --ci --codeCoverage --runner=ci --parallel --base=remotes/origin/master~1
  </code></pre>
  <p>For each feature we have a feature branch which is being build in our pipeline. For that the master is merged with the PR and then the pipe is being executed.</p>
  <p>Both versions of the above scripts worked fine when those PR pipelines where running, but once the PR is approved and merged into master, the pipelines are executed again and then the pipeline is running through but it is not building anything and the deployment is failing because it doesn't contain any artifacts. In the pipeline output we see the message:</p>
  <pre><code>NX  No projects with &quot;build&quot; that are configured for &quot;production&quot; were run
  </code></pre>
  <p>I did some research and gathered from there that maybe the head and/or base property are set incorrectly so that Nx doesn't find any changes during the run on master after the merge. But I wasn't able to figure out what the correct setup would be. I would appreciate a lot if someone could help me out there.</p>
  <p>If you need more information please let me know.</p>