title: How to prevent a YAML Deployment Pipeline from running when the Build Pipeline doesn't produce an artifact
body: <p>We have a build pipeline that gets triggered for a CI build that only publishes artifacts when the build succeeds and is not a PR build nor a Scheduled build.</p>
  <p>We only want the release pipeline defined below to run when the build pipeline publishes an artifact. If it doesn't publish an artifact the triggered release pipeline fails.</p>
  <p>My understanding that I believe is from reading docs.microsoft.com was that if the resource doesn't produce an artifact it won't trigger a resource trigger (I currently can't find support for that claim). We just added a scheduled nightly build for running some long running tests to the build pipeline.  As configured the conditions on the publish tasks prevented an artifact from being created but the release pipeline is still being triggered and results in a failure.</p>
  <pre><code>trigger: none
  pr: none
  resources:
    pipelines:
    - pipeline: API-Deployment 
      source: API-Build  
      trigger: 
        branches:
          include: 
          - refs/heads/main
  </code></pre>
  <p>How do we prevent the release pipeline from running when the build pipeline is triggered by a scheduled or a PR build?  Or how can we inspect to find out whether or not the triggering build produced an artifact so that we can prevent stages/jobs/tasks from running and failing when an artifact doesn't exist?</p>