From ae43bb391ce93f7325f026446d573b1ac9a3ed6b Mon Sep 17 00:00:00 2001 From: Andrew Sazonov Date: Thu, 26 Feb 2026 00:22:26 +0100 Subject: [PATCH] Add concurrency to PR labels workflow --- .copier-answers.yml | 2 +- .github/configs/rulesets-develop.json | 2 +- .github/workflows/pr-labels.yml | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index b9f9b63..2ed76aa 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ # WARNING: Do not edit this file manually. # Any changes will be overwritten by Copier. -_commit: v0.5.0-9-g8a8e235 +_commit: v0.5.0-11-g88c9a0e _src_path: gh:easyscience/templates lib_docs_url: https://easyscience.github.io/utils lib_doi: 10.5281/zenodo.18163581 diff --git a/.github/configs/rulesets-develop.json b/.github/configs/rulesets-develop.json index 61d7856..04489e5 100644 --- a/.github/configs/rulesets-develop.json +++ b/.github/configs/rulesets-develop.json @@ -29,7 +29,7 @@ "dismiss_stale_reviews_on_push": false, "require_code_owner_review": false, "require_last_push_approval": false, - "required_approving_review_count": 1, + "required_approving_review_count": 0, "required_review_thread_resolution": false } } diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml index be5194a..2571063 100644 --- a/.github/workflows/pr-labels.yml +++ b/.github/workflows/pr-labels.yml @@ -1,5 +1,17 @@ # Verifies if a pull request has at least one label from a set of valid # labels before it can be merged. +# +# NOTE: +# This workflow may be triggered twice in quick succession when a PR is +# created: +# 1) `opened` — when the pull request is initially created +# 2) `labeled` — if labels are added immediately after creation +# (e.g. by manual labeling, another workflow, or GitHub App). +# +# These are separate GitHub events, so two workflow runs can be started. +# The `concurrency` configuration below ensures that only the latest run +# for the same PR remains active, canceling any previous in-progress +# run. name: PR labels check @@ -7,6 +19,10 @@ on: pull_request_target: types: [opened, labeled, unlabeled, synchronize] +concurrency: + group: pr-labels-${{ github.event.pull_request.number }} + cancel-in-progress: true + permissions: pull-requests: read