diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 9f2480d88..fd5b34876 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -18,9 +18,10 @@ jobs: name: Build runs-on: macos-11 - # Only allow a single run of this workflow on each branch (cancel older runs automatically) concurrency: - group: build-${{ github.head_ref }} + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('build-develop-{0}', github.sha) || format('build-{0}', github.ref) }} cancel-in-progress: true steps: diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index aa9645b29..0fd4f4f61 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -18,9 +18,10 @@ jobs: name: Tests runs-on: macos-11 - # Only allow a single run of this workflow on each branch (cancel older runs automatically) concurrency: - group: tests-${{ github.head_ref }} + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('tests-develop-{0}', github.sha) || format('tests-{0}', github.ref) }} cancel-in-progress: true steps: diff --git a/.github/workflows/release-alpha.yml b/.github/workflows/release-alpha.yml index 544a05e28..887419e26 100644 --- a/.github/workflows/release-alpha.yml +++ b/.github/workflows/release-alpha.yml @@ -17,9 +17,10 @@ jobs: name: Release runs-on: macos-11 - # Only allow a single run of this workflow on each branch (cancel older runs automatically) concurrency: - group: alpha-${{ github.head_ref }} + # When running on develop, use the sha to allow all runs of this workflow to run concurrently. + # Otherwise only allow a single run of this workflow on each branch, automatically cancelling older runs. + group: ${{ github.ref == 'refs/heads/develop' && format('alpha-develop-{0}', github.sha) || format('alpha-{0}', github.ref) }} cancel-in-progress: true steps: diff --git a/changelog.d/5039.build b/changelog.d/5039.build index 0da3a457f..f791f36fb 100644 --- a/changelog.d/5039.build +++ b/changelog.d/5039.build @@ -1 +1 @@ -Add concurrency to the GitHub workflows to auto-cancel older runs of each action. \ No newline at end of file +Add concurrency to the GitHub workflows to auto-cancel older runs of each action for PRs. \ No newline at end of file