From 6e2809c5f9956f44abbeb49c4b56cc5d49b3d88b Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 3 Jun 2021 15:33:22 -0300 Subject: [PATCH] Group workflow by branch except main. --- .github/workflows/angular.yml | 3 ++- .github/workflows/generator.yml | 3 ++- .github/workflows/gradle-wrapper-validation.yml | 3 ++- .github/workflows/incremental-changelog.yml | 3 ++- .github/workflows/jdl.yml | 3 ++- .github/workflows/react.yml | 3 ++- .github/workflows/vue.yml | 3 ++- .github/workflows/webflux.yml | 3 ++- 8 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/angular.yml b/.github/workflows/angular.yml index 79a2ce58620..e6f5b90c587 100644 --- a/.github/workflows/angular.yml +++ b/.github/workflows/angular.yml @@ -19,7 +19,8 @@ name: Angular concurrency: - group: angular-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: angular-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/generator.yml b/.github/workflows/generator.yml index 88ac74a86c0..52bc6a6fa29 100644 --- a/.github/workflows/generator.yml +++ b/.github/workflows/generator.yml @@ -19,7 +19,8 @@ name: Generator concurrency: - group: generator-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: generator-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml index ee2cc14bc5c..a2955480212 100644 --- a/.github/workflows/gradle-wrapper-validation.yml +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -19,7 +19,8 @@ name: 'Validate Gradle Wrapper' concurrency: - group: gradle-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: gradle-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/incremental-changelog.yml b/.github/workflows/incremental-changelog.yml index c58b088bdc6..956071b46ac 100644 --- a/.github/workflows/incremental-changelog.yml +++ b/.github/workflows/incremental-changelog.yml @@ -19,7 +19,8 @@ name: Incremental Changelog concurrency: - group: incremental-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: incremental-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/jdl.yml b/.github/workflows/jdl.yml index 12e05546869..1d53f065366 100644 --- a/.github/workflows/jdl.yml +++ b/.github/workflows/jdl.yml @@ -19,7 +19,8 @@ name: JDL tests concurrency: - group: jdl-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: jdl-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/react.yml b/.github/workflows/react.yml index b4f86b04331..3bd6afec086 100644 --- a/.github/workflows/react.yml +++ b/.github/workflows/react.yml @@ -19,7 +19,8 @@ name: React concurrency: - group: react-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: react-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/vue.yml b/.github/workflows/vue.yml index 26ad26c9577..c2a9facf72d 100644 --- a/.github/workflows/vue.yml +++ b/.github/workflows/vue.yml @@ -19,7 +19,8 @@ name: Vue concurrency: - group: vue-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: vue-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: diff --git a/.github/workflows/webflux.yml b/.github/workflows/webflux.yml index 103303047e6..40f16bb4f89 100644 --- a/.github/workflows/webflux.yml +++ b/.github/workflows/webflux.yml @@ -19,7 +19,8 @@ name: Webflux concurrency: - group: webflux-${{ github.head_ref || github.sha }} + # Group PRs by head_ref, push to main branch by commit id, and others branch by ref. + group: webflux-${{ github.head_ref || (github.ref == 'refs/heads/main' && github.sha) || github.ref }} cancel-in-progress: true on: push: