title: How to run a github actions job on workflow failure?
body: <p>I want to run a notification job that lets me know that my workflow failed, is there a way to do that without having to <code>needs</code> every job and checking the status of each one?</p>
  <p>This is how I would have to do it now but it gets cumbersome if I have a ton of jobs:</p>
  <pre><code>jobs:
    first-job:
      runs-on: ubuntu-20.04
      steps:
        - exit 0
  
  
    second-job:
      runs-on: ubuntu-20.04
      steps:
        - exit 1
  
    notify-job:
      runs-on: ubuntu-20.04
      needs: [first-job, second-job]
      if: ${{ always() &amp;&amp; (needs.first-job.result == 'failure' || needs.second-job.result == 'failure') }}
      steps:
        - ./notify.sh
  </code></pre>
  <p>I want to simply check if the workflow failed in any capacity at the end, i.e. if any job failed, is that possible?</p>
  <p>I see this documentation to check if the triggering workflow failed (<a href="https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow" rel="nofollow noreferrer">https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#running-a-workflow-based-on-the-conclusion-of-another-workflow</a>).</p>
  <p>Is there a way to run a <code>finally</code> or <code>ensure</code> status check at the end of the <strong>current</strong> workflow?</p>