Skip to content

Commit 27931ff

Browse files
Fix Android template E2E for PRs targeting stable branches (#57650)
On pull_request events github.ref_name is "<pr-number>/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.
1 parent a8eb4f7 commit 27931ff

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/e2e-android-templateapp.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,11 @@ jobs:
5656
MAVEN_LOCAL=/tmp/react-native-tmp/maven-local
5757
echo "Maven local path is $MAVEN_LOCAL"
5858
59-
# For stable branches, we want to use the stable branch of the template
60-
# In all the other cases, we want to use "main"
61-
BRANCH=${{ github.ref_name }}
59+
# For stable branches, we want to use the stable branch of the template.
60+
# In all the other cases, we want to use "main".
61+
# On pull_request events, ref_name is "<pr-number>/merge", so use the
62+
# PR base branch instead to keep targeting the matching template branch.
63+
BRANCH=${{ github.base_ref || github.ref_name }}
6264
if ! [[ $BRANCH == *-stable* ]]; then
6365
BRANCH=main
6466
fi

0 commit comments

Comments
 (0)