From 9572788ae3bf04a1c83f4a60d36c887f0bf8de30 Mon Sep 17 00:00:00 2001 From: Ian Henriksen Date: Mon, 7 Oct 2024 15:12:32 -0600 Subject: [PATCH] Auto-cancel github actions workflow if a newer commit gets pushed to a given branch/PR. --- .github/workflows/CI.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a3b5936c9..8a5187c64 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,6 +2,12 @@ name: CI on: [push, pull_request] +# Cancel the current workflow if a newer commit gets pushed to the +# branch or PR that triggered it. +concurrency: + group: ${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} + jobs: linux-gcc: runs-on: ubuntu-22.04