From 42e8bfefa642f4e40d5648021762180108158a24 Mon Sep 17 00:00:00 2001 From: Vitor Mattos Date: Mon, 21 Sep 2026 21:02:11 -0300 Subject: [PATCH] fix: scope nightly concurrency by stable branch Signed-off-by: Vitor Mattos --- tests/test_nightly_release_template.py | 9 +++++++++ workflow-templates/nightly-release.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_nightly_release_template.py b/tests/test_nightly_release_template.py index 482fa1a..ba9b26c 100644 --- a/tests/test_nightly_release_template.py +++ b/tests/test_nightly_release_template.py @@ -43,6 +43,15 @@ def test_checkout_credentials_are_not_persisted(self) -> None: self.assertIn("permissions:\n contents: write", content) self.assertNotIn("actions: write", content) + def test_concurrency_only_cancels_runs_for_the_same_branch(self) -> None: + content = TEMPLATE.read_text(encoding="utf-8") + + self.assertIn( + "group: nightly-release-${{ github.repository }}-${{ github.ref_name }}", + content, + ) + self.assertIn("cancel-in-progress: true", content) + if __name__ == "__main__": unittest.main() diff --git a/workflow-templates/nightly-release.yml b/workflow-templates/nightly-release.yml index f0a0f78..abfd431 100644 --- a/workflow-templates/nightly-release.yml +++ b/workflow-templates/nightly-release.yml @@ -18,7 +18,7 @@ permissions: contents: write concurrency: - group: nightly-release-${{ github.repository }} + group: nightly-release-${{ github.repository }}-${{ github.ref_name }} cancel-in-progress: true jobs: