mirror of
https://github.com/react/react-native.git
synced 2026-09-28 13:23:09 +08:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/56871 `diff-js-api-changes` was posting false positive "JavaScript API change detected" warnings on PRs that never modified `ReactNativeApi.d.ts`. This happened because the action ran `git merge-base` against limited local history (`git fetch --depth=500`), which couldn't find the common ancestor for branches that were far behind main — including (often) pick requests to release branches. The fallback wrote an empty "before" snapshot, causing the entire API surface to appear newly added. {F1989977284} #### Changes - Query the GitHub API first — if the PR doesn't touch `ReactNativeApi.d.ts`, skip the diff entirely. - When the snapshot is touched, use the GitHub compare API to resolve the merge base instead of relying on local git history. - Limit the check to PRs targeting `main` or `*-stable` branches. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D105572432 fbshipit-source-id: 20e5db01c9e6b51acb55548746c8fd512a363274