[TIL] GitHub Actions: how to get execution status of a specific job

TIL that in GitHub Actions, one can use needs.job.result to get the execution status of a specific job.

Let's say you have a job named invalidate-cache. You can then, in another job, check its execution status, like so:

if: needs.invalidate-cache.result == 'success'