A platform for community discussion. Free, open, simple.
DEV: Limit CI concurrency per branch and pull request (#45301)
Penar Musaraj1a166f40bbb8
diff --git a/.github/workflows/developer-docs-lint.yml b/.github/workflows/developer-docs-lint.ymlindex 8889f2d30ee..1b316e1f7af 100644--- a/.github/workflows/developer-docs-lint.yml+++ b/.github/workflows/developer-docs-lint.yml@@ -13,8 +13,8 @@ on:- ".github/workflows/developer-docs-lint.yml"concurrency:- group: developer-docs-lint-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}permissions:contents: readdiff --git a/.github/workflows/licenses.yml b/.github/workflows/licenses.ymlindex 650a836bf83..6e0704cfb00 100644--- a/.github/workflows/licenses.yml+++ b/.github/workflows/licenses.yml@@ -7,8 +7,8 @@ on:- mainconcurrency:- group: licenses-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}permissions:contents: readdiff --git a/.github/workflows/linting.yml b/.github/workflows/linting.ymlindex c2a768a8e01..abff6930fcf 100644--- a/.github/workflows/linting.yml+++ b/.github/workflows/linting.yml@@ -7,8 +7,8 @@ on:- mainconcurrency:- group: linting-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}permissions:contents: readdiff --git a/.github/workflows/migration-tests.yml b/.github/workflows/migration-tests.ymlindex c96edab8224..e6a9121dab2 100644--- a/.github/workflows/migration-tests.yml+++ b/.github/workflows/migration-tests.yml@@ -14,8 +14,8 @@ on:- "migrations/**"concurrency:- group: migration-tests-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}permissions:contents: readdiff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex aed561ee737..251f2d094df 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -15,8 +15,8 @@ on:- release/*concurrency:- group: tests-${{ format('{0}-{1}', github.head_ref || github.run_number, github.job) }}- cancel-in-progress: true+ group: ${{ github.workflow }}-${{ github.ref }}+ cancel-in-progress: ${{ github.event_name == 'pull_request' }}permissions:contents: read@@ -415,7 +415,7 @@ jobs:deprecation-report:name: JS deprecation report- if: always() && github.repository == 'discourse/discourse' && needs.build.result != 'skipped'+ if: ${{ !cancelled() && github.repository == 'discourse/discourse' && needs.build.result != 'skipped' }}runs-on: ubuntu-latestneeds: buildpermissions: