diff --git a/.github/workflows/sonarcloud.yaml b/.github/workflows/sonarcloud.yaml index 0d63faca6..870c076be 100644 --- a/.github/workflows/sonarcloud.yaml +++ b/.github/workflows/sonarcloud.yaml @@ -5,6 +5,15 @@ on: - main pull_request: types: [opened, synchronize, reopened] + +# Ensure that only one instance of the workflow is run at a time for each branch/tag. +# Jobs currently running on the branch/tag will be cancelled when new commits are pushed. +# See https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions#concurrency. +concurrency: + # `github.workflow` is the workflow name, `github.ref` is the current branch/tag identifier + group: ${{ format('{0}:{1}', github.workflow, github.ref) }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + jobs: sonarcloud: name: SonarCloud