How do you make one job wait for another in GitHub Actions?
⚡
Quick Answer
Use needs: to declare a dependency, turning parallel jobs into an ordered pipeline.
Detailed Answer
By default jobs run in parallel. needs: build makes the deploy job start only after build succeeds, and exposes build's outputs. Combine with environment: for gated deploys. Without needs, there's no ordering guarantee.
Code Example
deploy: needs: build runs-on: ubuntu-latest
💡
Interview Tip
Mention that needs also passes job outputs downstream.
github-actionsneedspipeline