From 12d7303707583c27c251176246876f263f4e1de2 Mon Sep 17 00:00:00 2001
From: Quentin Gliech <quenting@element.io>
Date: Mon, 17 Jun 2024 13:21:51 +0200
Subject: [PATCH] Use the release branch for sytest in release-branch PRs
 (#17306)

---
 .github/workflows/tests.yml | 3 +++
 changelog.d/17306.misc      | 1 +
 2 files changed, 4 insertions(+)
 create mode 100644 changelog.d/17306.misc

diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 20afe311fe..cdd881fbe1 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -479,6 +479,9 @@ jobs:
       volumes:
         - ${{ github.workspace }}:/src
       env:
+        # If this is a pull request to a release branch, use that branch as default branch for sytest, else use develop
+        # This works because the release script always create a branch on the sytest repo with the same name as the release branch
+        SYTEST_DEFAULT_BRANCH: ${{ startsWith(github.base_ref, 'release-') && github.base_ref || 'develop' }}
         SYTEST_BRANCH: ${{ github.head_ref }}
         POSTGRES: ${{ matrix.job.postgres && 1}}
         MULTI_POSTGRES: ${{ (matrix.job.postgres == 'multi-postgres') || '' }}
diff --git a/changelog.d/17306.misc b/changelog.d/17306.misc
new file mode 100644
index 0000000000..88ada5f671
--- /dev/null
+++ b/changelog.d/17306.misc
@@ -0,0 +1 @@
+Use the release branch for sytest in release-branch PRs.
-- 
GitLab