Interview Prep/CI/CD/GitHub Actions

Pushing twice to a PR branch starts two CI runs, and the older one is wasted.

BeginnerScenarioGitHub Actions
Answer

Situation read → No concurrency control.

What I'd do →

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

Do not cancel in-progress deploys: for deploy workflows use a group with cancel-in-progress: false so runs queue.

Why → Cancelling stale CI saves minutes, while deploys should finish cleanly.

Interview tip → Know that a concurrency group holds one running and at most one pending run.

All CI/CD questions

More on GitHub Actions