From 8b2bfc41c51a975a1e0ca0197b9b6e9f4542ae90 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Mon, 21 Feb 2022 23:37:36 +0100 Subject: [PATCH] Improve concurrency of GitHub Actions (#1128) * improve concurrency of GitHub Actions This will allow you to cancel older running actions for the current PR / branch. This saves you some resources, but more importantly hopefully frees up some spots in the queue a bit faster. Saw this on the Node.js repo: https://github.com/nodejs/node/pull/42017 * empty commit to trigger cancellation of previous commit --- .github/workflows/main.yml | 4 ++++ .github/workflows/release-insiders.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c61462c..2122e99 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,10 @@ name: CI on: [push] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + env: NODE_VERSION: 12.x diff --git a/.github/workflows/release-insiders.yml b/.github/workflows/release-insiders.yml index e6891fa..85ea848 100644 --- a/.github/workflows/release-insiders.yml +++ b/.github/workflows/release-insiders.yml @@ -4,6 +4,10 @@ on: push: branches: [main] +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest