From a06f8f68aece858be5937d89e68f2612c17bb0de Mon Sep 17 00:00:00 2001 From: Earlopain <14981592+Earlopain@users.noreply.github.com> Date: Tue, 7 Jan 2025 21:02:19 +0100 Subject: [PATCH] Only cancel in-progress workflows for pull requests https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#example-using-a-fallback-value This way, if a bunch of stuff gets merged one after the other, CI on main is not often displayed red. `build-artifacts.yml` doesn't run on PRs but I don't think it hurt to have this uniform in case it gets copied around --- .github/workflows/build-artifacts.yml | 2 +- .github/workflows/cruby-bindings.yml | 2 +- .github/workflows/documentation.yml | 2 +- .github/workflows/main.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 949d11c135..0b829bdec6 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1,7 +1,7 @@ name: Build Library Artifacts concurrency: - group: "${{github.workflow}}-${{github.ref}}" + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true on: diff --git a/.github/workflows/cruby-bindings.yml b/.github/workflows/cruby-bindings.yml index 97093304d7..5458d80694 100644 --- a/.github/workflows/cruby-bindings.yml +++ b/.github/workflows/cruby-bindings.yml @@ -1,7 +1,7 @@ name: CRuby bindings concurrency: - group: "${{github.workflow}}-${{github.ref}}" + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true on: diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index d5774705fa..43300482c1 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,7 +1,7 @@ name: Documentation concurrency: - group: "${{github.workflow}}-${{github.ref}}" + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true on: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b39744ccee..735f5e7e3b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,7 +1,7 @@ name: Main concurrency: - group: "${{github.workflow}}-${{github.ref}}" + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true on: