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.
More on GitHub Actions
What are workflows, jobs, steps and actions in GitHub Actions?BeginnerWhat events can trigger a workflow?BeginnerWhat is the difference between `pull_request` and `pull_request_target`?AdvancedWhat is a runner, and how do GitHub-hosted and self-hosted runners differ?BeginnerHow do you pass data between steps and between jobs?IntermediateHow does a build matrix work?Intermediate