mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Remove repeat checkout step from diff-js-api-changes (fix CI) (#54865)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54865 Removes introduced in D88654826, replaced with a `git fetch` with `--depth`. This should fix CI runs on `main` (where we believe the extra checkout is clobbering the `yarn-install` step), and improve execution time. Also shorten action name. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D89044330 fbshipit-source-id: 690eb5c7db9490e5f160e933d64eae6ac21464c8
This commit is contained in:
1 parent
b7ca04844d
commit
72097f0718
3 files changed
+11
-18
No files matched your search
@@ -0,0 +1,36 @@
|
||||
name: diff-js-api-changes
|
||||
description: Check for breaking changes in the public React Native JS API
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Get merge base commit with main
|
||||
id: merge_base
|
||||
shell: bash
|
||||
run: |
|
||||
git fetch origin main
|
||||
git fetch origin ${{ github.event.pull_request.head.sha }} --depth=100
|
||||
BASE=$(git merge-base ${{ github.event.pull_request.head.sha }} origin/main)
|
||||
echo "merge_base=$BASE" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Fetch snapshots from PR head and merge base
|
||||
shell: bash
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-changes
|
||||
run: |
|
||||
mkdir -p $SCRATCH_DIR
|
||||
# Fetch from merge base
|
||||
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
|
||||
# Fetch from PR head
|
||||
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
|
||||
env:
|
||||
SCRATCH_DIR: ${{ runner.temp }}/diff-js-api-changes
|
||||
run: |
|
||||
node ./scripts/js-api/diff-api-snapshot \
|
||||
$SCRATCH_DIR/ReactNativeApi-before.d.ts \
|
||||
$SCRATCH_DIR/ReactNativeApi-after.d.ts \
|
||||
> $SCRATCH_DIR/output.json
|
||||
Reference in new issue
Block a user