From 2bd082601b27c64545e0fa72ccc0687fa9cf6aa4 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Date: Thu, 23 Jul 2026 12:51:24 -0300 Subject: [PATCH] Fix Android template E2E for PRs targeting stable branches On pull_request events github.ref_name is "/merge", which never matches *-stable*, so the template E2E always cloned the template's main branch. Template main now ships a Gradle 9.4.1 wrapper (bundling Kotlin 2.3.0), whose metadata the Kotlin 2.1.0 compiler used by @react-native/gradle-plugin on 0.86 cannot read, breaking :gradle-plugin:settings-plugin:compileKotlin on every PR to 0.86-stable. Use github.base_ref (set on PR events) so PRs targeting stable branches check out the matching template branch, falling back to ref_name for branch pushes. --- .github/workflows/e2e-android-templateapp.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-android-templateapp.yml b/.github/workflows/e2e-android-templateapp.yml index a889a52d7b4a..2f20edd2dbc9 100644 --- a/.github/workflows/e2e-android-templateapp.yml +++ b/.github/workflows/e2e-android-templateapp.yml @@ -56,9 +56,11 @@ jobs: MAVEN_LOCAL=/tmp/react-native-tmp/maven-local echo "Maven local path is $MAVEN_LOCAL" - # For stable branches, we want to use the stable branch of the template - # In all the other cases, we want to use "main" - BRANCH=${{ github.ref_name }} + # For stable branches, we want to use the stable branch of the template. + # In all the other cases, we want to use "main". + # On pull_request events, ref_name is "/merge", so use the + # PR base branch instead to keep targeting the matching template branch. + BRANCH=${{ github.base_ref || github.ref_name }} if ! [[ $BRANCH == *-stable* ]]; then BRANCH=main fi