workflow

concurrency:

Limits concurrent runs that share the same group so only one is active (and at most one pending). Set at the workflow or job level to serialize deploys or cancel superseded PR builds.

concurrency:
  group: <string>
  cancel-in-progress: true|false

Common values / subkeys

Value / Subkey Purpose
group Grouping key, usually built from workflow + ref (supports expressions)
cancel-in-progress Cancel any in-progress run in the same group when a new one queues

Examples

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

Cancel stale PR/branch builds when a new commit lands

concurrency:
  group: deploy-prod
  cancel-in-progress: false

Serialize prod deploys, queue rather than cancel

jobs:
  release:
    concurrency: release-${{ github.ref }}

Short-form: string is the group name

Gotcha

Only one run can be pending per group — if a third run arrives while one is running and one is pending, the pending run is cancelled, not queued.

Related keywords

← All GitHub Actions syntax · Git commands · Cron syntax