Cancel in-progress workflow runs for pull requests and dispatches (#16601)

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.

Closes #16601

COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16601 from sethvargo:sethvargo/actions-concurrency 82fd070dba
PiperOrigin-RevId: 629805311
pull/16685/head
Seth Vargo 11 months ago committed by Copybara-Service
parent 990380bc55
commit 4f23cafa02
  1. 4
      .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

Loading…
Cancel
Save