Sitemap
Wouter

Wouter

Cloud Engineer Proud owner of wouterplanet.com

Member-only story

Github Workflows: working with concurrency

3 min readJul 28, 2026

--

When running SonarQube in GitHub Actions, you often want to avoid multiple scans running at the same time.

Imagine you have a Sonarqube set up in your repo and you want to configure your workflows so that only one Sonarqube scan is allowed at the same time. GitHub Actions concurrency lets you do this in different ways depending on whether you want to:

  1. Replace older runs with newer ones, or
  2. Queue runs and process them one at a time

The concurrency keyword

concurrency in GitHub Actions controls how many executions are allowed at the same time for a given concurrency group.

You can define it at two scopes:

Workflow (pipeline) level

When concurrency is defined at the top of the workflow file, it applies to the entire workflow run.

name: CI

on:
push:

concurrency:
group: ci-${{ github.repository }}-${{ github.ref }}
cancel-in-progress: false
queue: max

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "Build"

sonarqube:
runs-on: ubuntu-latest
steps:
- run: echo "Scan"

Effect: only one full workflow run in that group proceeds at a time.

Job level

--

--