Cherry-pick Request
Target Branch
0.84
Link to commit or PR to be picked
facebook/react-native#55808
Description
When a PR targets a -stable branch, github.ref_name is the PR branch (not ending in -stable), so the version script was incorrectly running. Added a check for github.base_ref to also skip the script when the PR target branch is a stable branch.
This fix is needed to ensure CI works correctly for PRs targeting stable branches.