diff --git a/.github/workflows/build-android-templateapp.yml b/.github/workflows/build-android-templateapp.yml index af879834bd2..6d761ed6ee5 100644 --- a/.github/workflows/build-android-templateapp.yml +++ b/.github/workflows/build-android-templateapp.yml @@ -47,7 +47,7 @@ jobs: # Stable branches use their matching template branch. All other # builds use the template's main branch. - BRANCH=${{ github.ref_name }} + BRANCH=${{ github.base_ref || github.ref_name }} if ! [[ $BRANCH == *-stable* ]]; then BRANCH=main fi diff --git a/.github/workflows/build-ios-templateapp.yml b/.github/workflows/build-ios-templateapp.yml index 8285dc22af5..5edf802b144 100644 --- a/.github/workflows/build-ios-templateapp.yml +++ b/.github/workflows/build-ios-templateapp.yml @@ -67,7 +67,7 @@ jobs: # 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 }} + BRANCH=${{ github.base_ref || github.ref_name }} if ! [[ $BRANCH == *-stable* ]]; then BRANCH=main fi diff --git a/.github/workflows/e2e-android-templateapp.yml b/.github/workflows/e2e-android-templateapp.yml index f3dfcc17181..1eb9dca2610 100644 --- a/.github/workflows/e2e-android-templateapp.yml +++ b/.github/workflows/e2e-android-templateapp.yml @@ -51,7 +51,7 @@ jobs: # 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 }} + BRANCH=${{ github.base_ref || github.ref_name }} if ! [[ $BRANCH == *-stable* ]]; then BRANCH=main fi diff --git a/.github/workflows/e2e-ios-templateapp.yml b/.github/workflows/e2e-ios-templateapp.yml index 6559042828f..fd94134e41e 100644 --- a/.github/workflows/e2e-ios-templateapp.yml +++ b/.github/workflows/e2e-ios-templateapp.yml @@ -96,7 +96,7 @@ jobs: REACT_NATIVE_PKG=$(find /tmp/react-native-tmp -type f -name "*.tgz") echo "React Native tgs is $REACT_NATIVE_PKG" - BRANCH=${{ github.ref_name }} + BRANCH=${{ github.base_ref || github.ref_name }} if ! [[ $BRANCH == *-stable* ]]; then BRANCH=main fi