From df83261d745b5d114279fa064f3e950e15c6d445 Mon Sep 17 00:00:00 2001 From: Josh de Leeuw Date: Fri, 17 Jan 2025 11:02:29 -0500 Subject: [PATCH] Use `concurrency` instead of `if` --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc137c92..a75f98fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,11 +2,13 @@ name: build on: [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Build, lint, and test on Node.js ${{ matrix.node }} - # Prevent the action running twice when the event is both a push and pull request - if: github.event_name != 'push' || github.event_name == 'push' && !github.event.pull_request runs-on: ubuntu-latest strategy: matrix: