Run GitHub actions job only if previous job has failed

I am trying to run a job in a GitHub workflow only if one (or more) of the previous jobs has failed.

So at the moment I have something like:

job1:
  steps:
    -
    -
job2:
  steps:
    -
    -
run-if-fail:
  if: ${{ always() && (needs.job1.result=='failure' || needs.job2.result=='failure') }}
  needs: [job1, job2]
  steps:
    -
    -

However, the run-if-fail job seems to run always, ignoring job1 and job2 result.