Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions .github/actions/diff-js-api-changes/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,25 @@ description: Check for breaking changes in the public React Native JS API
runs:
using: composite
steps:
- name: Compute merge base with main
- name: Fetch PR and main, compute merge base
id: merge_base
shell: bash
run: |
git fetch origin main
git fetch --deepen=500
echo "merge_base=$(git merge-base HEAD origin/main)" >> $GITHUB_OUTPUT
git fetch origin ${{ github.event.pull_request.head.sha }} --depth=500
echo "merge_base=$(git merge-base ${{ github.event.pull_request.head.sha }} origin/main)" >> $GITHUB_OUTPUT

- name: Output snapshot before state for comparison
- name: Extract before and after API snapshots
shell: bash
env:
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-changes
run: |
rm -rf $SCRATCH_DIR
mkdir -p $SCRATCH_DIR
git show ${{ steps.merge_base.outputs.merge_base }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-before.d.ts \
|| echo "" > $SCRATCH_DIR/ReactNativeApi-before.d.ts
git show ${{ github.event.pull_request.head.sha }}:packages/react-native/ReactNativeApi.d.ts > $SCRATCH_DIR/ReactNativeApi-after.d.ts \
|| echo "" > $SCRATCH_DIR/ReactNativeApi-after.d.ts

- name: Run breaking change detection
shell: bash
Expand All @@ -27,5 +30,5 @@ runs:
run: |
node ./scripts/js-api/diff-api-snapshot \
$SCRATCH_DIR/ReactNativeApi-before.d.ts \
./packages/react-native/ReactNativeApi.d.ts \
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
> $SCRATCH_DIR/output.json
2 changes: 1 addition & 1 deletion .github/workflows/danger-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Check out PR branch
- name: Check out main branch
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
Expand Down