Skip to content

Use the PR base branch to pick the template in template app workflows - #60559

Merged
gabrieldonadel merged 1 commit into
react:mainfrom
gabrieldonadel:@gabrieldonadel/0.88-template-e2e-base-ref
Dec 5, 2026
Merged

gabrieldonadel merged 1 commit into
react:mainfrom
gabrieldonadel:@gabrieldonadel/0.88-template-e2e-base-ref

Conversation

@gabrieldonadel

@gabrieldonadel gabrieldonadel commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary:

The template app workflows pick the template branch from github.ref_name. On a pull request that is <number>/merge, which has no -stable in it, so they fall back to the template's main branch even when the PR targets a stable branch.

On main this is harmless, since template main is the right one there. But every stable branch is cut from main with these files, and its PRs then build and test against template main instead of the matching stable template.

On 0.88-stable this breaks every PR (#60477, #60550, #60553): the PR run installs react-native-community-template-0.83.0-main.tgz, while the branch run installs 0.88.1. Template main pins @react-native-community/cli 22.0.0-alpha.0, whose build/index.js no longer exports createDevServerMiddleware. On 0.88, loadCommunityMiddleware reads exactly that export, so react-native start exits with createCommunityMiddleware is not a function. The Debug app shows "No script URL provided" and Maestro fails start.yml in all three attempts.

This uses github.base_ref when it is set, in build-android-templateapp.yml, build-ios-templateapp.yml, e2e-android-templateapp.yml and e2e-ios-templateapp.yml. 0.89-stable already has this change in its two iOS files (#60264). Pushes are unchanged, since base_ref is empty there.

Needs cherry-picks

This fixes future branch cuts. The branches already cut need it picked:

  • 0.88-stable: only e2e-android-templateapp.yml and e2e-ios-templateapp.yml exist there. The build workflows are not on that branch, so the pick conflicts on those two files and drops them.
  • 0.89-stable: the iOS files already have it, so only build-android-templateapp.yml and e2e-android-templateapp.yml change.

Changelog:

[INTERNAL] [FIXED] - Use the PR base branch to pick the template in template app workflows

Test Plan:

  • All four workflow files parse as YAML.
  • On main nothing changes in practice: for a PR against main, base_ref is main, which is also what the fallback picked.
  • The real test is a PR against a stable branch after the cherry-pick: test_e2e_{ios,android}_templateapp should clone the stable template and pass.

@gabrieldonadel
gabrieldonadel marked this pull request as ready for review December 4, 2026 17:42
@gabrieldonadel
gabrieldonadel force-pushed the @gabrieldonadel/0.88-template-e2e-base-ref branch from 2b3447d to 544b5f4 Compare December 4, 2026 17:43
@gabrieldonadel
gabrieldonadel changed the base branch from 0.88-stable to main December 4, 2026 17:43
@gabrieldonadel gabrieldonadel changed the title [0.88] Use the PR base branch to pick the template in template e2e Use the PR base branch to pick the template in template app workflows Dec 4, 2026
@gabrieldonadel
gabrieldonadel marked this pull request as draft December 4, 2026 17:44
On a pull request `github.ref_name` is `<number>/merge`, which has no
`-stable` in it, so the template app workflows fall back to the template's
`main` branch even when the PR targets a stable branch. On main that is
harmless, since `main` is the right template there. But every stable branch
is cut from main with these files, and its PRs then build and test against
template `main` instead of the matching stable template.

On 0.88-stable this breaks every PR: template `main` pins
@react-native-community/cli 22.0.0-alpha.0, which no longer exports
`createDevServerMiddleware`, so Metro exits with "createCommunityMiddleware
is not a function" and test_e2e_{ios,android}_templateapp fail in all three
attempts, while pushes to the branch pass.

Use `github.base_ref` when it is set, as 0.89-stable already does in its iOS
template workflows. Pushes are unchanged, since `base_ref` is empty there.

Signed-off-by: Gabriel Donadel <donadeldev@gmail.com>
@gabrieldonadel
gabrieldonadel force-pushed the @gabrieldonadel/0.88-template-e2e-base-ref branch from 544b5f4 to c47fa00 Compare December 4, 2026 17:45
@gabrieldonadel
gabrieldonadel marked this pull request as ready for review December 4, 2026 17:49
@gabrieldonadel
gabrieldonadel merged commit 01ec383 into react:main Dec 5, 2026
100 checks passed
@gabrieldonadel
gabrieldonadel deleted the @gabrieldonadel/0.88-template-e2e-base-ref branch December 5, 2026 14:31
gabrieldonadel added a commit that referenced this pull request Dec 5, 2026
…#60559)

On a pull request `github.ref_name` is `<number>/merge`, which has no
`-stable` in it, so the template app workflows fall back to the template's
`main` branch even when the PR targets a stable branch. On main that is
harmless, since `main` is the right template there. But every stable branch
is cut from main with these files, and its PRs then build and test against
template `main` instead of the matching stable template.

On 0.88-stable this breaks every PR: template `main` pins
@react-native-community/cli 22.0.0-alpha.0, which no longer exports
`createDevServerMiddleware`, so Metro exits with "createCommunityMiddleware
is not a function" and test_e2e_{ios,android}_templateapp fail in all three
attempts, while pushes to the branch pass.

Use `github.base_ref` when it is set, as 0.89-stable already does in its iOS
template workflows. Pushes are unchanged, since `base_ref` is empty there.

Signed-off-by: Gabriel Donadel <donadeldev@gmail.com>
(cherry picked from commit 01ec383)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants