From 2c774ff09b24a6401badb2ff4e6e0685da392a43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marko=20Bari=C5=A1i=C4=87?=
 <48765171+MarkoBarisic@users.noreply.github.com>
Date: Thu, 15 Feb 2024 15:33:14 +0100
Subject: [PATCH] Add rules for rc workflows (#1722)

---
 .github/workflows/release_debian10.yaml   | 10 +++++++++-
 .github/workflows/release_ubuntu2004.yaml | 10 +++++++++-
 .github/workflows/stress_test_large.yaml  |  8 +++++++-
 3 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/.github/workflows/release_debian10.yaml b/.github/workflows/release_debian10.yaml
index 9feb5b1f0..3f2f83ef3 100644
--- a/.github/workflows/release_debian10.yaml
+++ b/.github/workflows/release_debian10.yaml
@@ -1,4 +1,7 @@
 name: Release Debian 10
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref_name }}
+  cancel-in-progress: true
 
 on:
   workflow_dispatch:
@@ -10,7 +13,12 @@ on:
         options:
           - Release
           - RelWithDebInfo
-
+  push:
+    branches:
+      - "release/**"
+    tags:
+      - "v*.*.*-rc*"
+      - "v*.*-rc*"
   schedule:
     - cron: "0 22 * * *"
 
diff --git a/.github/workflows/release_ubuntu2004.yaml b/.github/workflows/release_ubuntu2004.yaml
index 77feea2fe..a2154f55a 100644
--- a/.github/workflows/release_ubuntu2004.yaml
+++ b/.github/workflows/release_ubuntu2004.yaml
@@ -1,4 +1,7 @@
 name: Release Ubuntu 20.04
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref_name }}
+  cancel-in-progress: true
 
 on:
   workflow_dispatch:
@@ -10,7 +13,12 @@ on:
         options:
           - Release
           - RelWithDebInfo
-
+  push:
+    branches:
+      - "release/**"
+    tags:
+      - "v*.*.*-rc*"
+      - "v*.*-rc*"
   schedule:
     - cron: "0 22 * * *"
 
diff --git a/.github/workflows/stress_test_large.yaml b/.github/workflows/stress_test_large.yaml
index bdb805f5d..712d245ae 100644
--- a/.github/workflows/stress_test_large.yaml
+++ b/.github/workflows/stress_test_large.yaml
@@ -1,4 +1,7 @@
 name: Stress test large
+concurrency:
+  group: ${{ github.workflow }}-${{ github.ref_name }}
+  cancel-in-progress: true
 
 on:
   workflow_dispatch:
@@ -10,7 +13,10 @@ on:
         options:
           - Release
           - RelWithDebInfo
-
+  push:
+    tags:
+      - "v*.*.*-rc*"
+      - "v*.*-rc*"
   schedule:
     - cron: "0 22 * * *"