From 306ff210d350812931de0860c8686587b7c47bf8 Mon Sep 17 00:00:00 2001 From: ydah <13041216+ydah@users.noreply.github.com> Date: Wed, 11 Jan 2023 12:21:49 +0900 Subject: [PATCH] Change concurrency only in Pull Request events The following are included as keys to the group. `${{ github.head_ref || github.run_id }}` This allows concurrency to work only with Push to PullRequest, and cancels all but the most recent push for successive pushes; for merge commits, in other words push events, `${{ github.run_id }}` is used, so The cancellation is not enforced because it is always a unique group. --- .github/workflows/codespell.yml | 2 +- .github/workflows/linting.yml | 2 +- .github/workflows/main.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml index e9dc06b17..fea536393 100644 --- a/.github/workflows/codespell.yml +++ b/.github/workflows/codespell.yml @@ -2,7 +2,7 @@ name: CodeSpell on: - pull_request concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: codespell: diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 0256c185f..b936392bb 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -2,7 +2,7 @@ name: Linting on: - pull_request concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: yamllint: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d06cc238f..612023672 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: - master concurrency: - group: ${{ github.workflow }}-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true jobs: