Skip to content

Commit

Permalink
Cancel on new job
Browse files Browse the repository at this point in the history
  • Loading branch information
TrentHouliston committed Sep 15, 2023
1 parent 37d5730 commit 225dbb6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/sonarcloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 225dbb6

Please sign in to comment.