From 82fd070dbad88920501f0f4452f93b687adc3120 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Mon, 22 Apr 2024 14:40:30 -0700 Subject: [PATCH] Cancel in-progress workflow runs for pull requests and dispatches This will reduce unnecessary resource consumption by cancelling running workflows when new commits are pushed to a PR or workflow dispatch. It does not cancel pushes to main or branches. --- .github/workflows/test_runner.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test_runner.yml b/.github/workflows/test_runner.yml index d67f45593b..70cfc27a4a 100644 --- a/.github/workflows/test_runner.yml +++ b/.github/workflows/test_runner.yml @@ -52,6 +52,10 @@ on: permissions: contents: read +concurrency: + group: ${{ github.event_name }}-${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: ${{ contains(fromJSON('["pull_request", "pull_request_target", "workflow_dispatch"]'), github.event_name) }} + jobs: check-tag: name: Check for Safety