Git & GitHub Interview Question #111

What is a GitHub Actions concurrency group?

Advanced GitHub Actions, Repository Internals, Submodules, LFS & Diagnostic Tools Senior Advanced

Quick Interview Answer

Concurrency controls how multiple workflow runs or jobs in the same logical group are handled. It can prevent overlapping deployments or cancel an older in-progress run when a newer run supersedes it.

Detailed Explanation

Concurrency controls how multiple workflow runs or jobs in the same logical group are handled. It can prevent overlapping deployments or cancel an older in-progress run when a newer run supersedes it.

A common use is ensuring that only one deployment to a particular environment proceeds at a time.

Code Example

concurrency:
  group: production-deployment
  cancel-in-progress: false

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - run: ./deploy.sh