Skip to content

Commit 42e8bfe

Browse files
committed
fix: scope nightly concurrency by stable branch
Signed-off-by: Vitor Mattos <vitor@php.rio>
1 parent f7ea3ed commit 42e8bfe

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

‎tests/test_nightly_release_template.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,15 @@ def test_checkout_credentials_are_not_persisted(self) -> None:
4343
self.assertIn("permissions:\n contents: write", content)
4444
self.assertNotIn("actions: write", content)
4545

46+
def test_concurrency_only_cancels_runs_for_the_same_branch(self) -> None:
47+
content = TEMPLATE.read_text(encoding="utf-8")
48+
49+
self.assertIn(
50+
"group: nightly-release-${{ github.repository }}-${{ github.ref_name }}",
51+
content,
52+
)
53+
self.assertIn("cancel-in-progress: true", content)
54+
4655

4756
if __name__ == "__main__":
4857
unittest.main()

‎workflow-templates/nightly-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ permissions:
1818
contents: write
1919

2020
concurrency:
21-
group: nightly-release-${{ github.repository }}
21+
group: nightly-release-${{ github.repository }}-${{ github.ref_name }}
2222
cancel-in-progress: true
2323

2424
jobs:

0 commit comments

Comments
 (0)