Interview Prep/Real-World Interview/Write-a-pipeline tasks

Write a workflow with concurrency so a newer push cancels an older running deploy for the same branch.

BeginnerHands-onWrite-a-pipeline tasks
Answer
concurrency:
  group: deploy-${{ github.ref }}
  cancel-in-progress: true

Key trick → Grouping by github.ref means one active run per branch. For production deploys or Terraform, set cancel-in-progress: false, because killing an apply halfway is worse than waiting.

All Real-World Interview questions Roadmap: Interview readiness

More on Write-a-pipeline tasks