Skip to content

Commit

Permalink
Make CircleCI run shallow clones of the React Native repo
Browse files Browse the repository at this point in the history
Summary:
# Changelog
[General][Fix] - Fix shallow cloning break on main.

Can you read me?

Differential Revision: D38858746

fbshipit-source-id: b2892ee267e42cb0e40b0df682932334f353a3ae
  • Loading branch information
throwaway-fishery authored and facebook-github-bot committed Aug 19, 2022
1 parent 6747835 commit 0843c56
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,15 @@ commands:
name: Shallow clone repo
command: |
git clone --branch main --no-checkout "$CIRCLE_REPOSITORY_URL" --single-branch .
git fetch --force --depth 1 origin +refs/pull/$CIRCLE_PR_NUMBER/head:refs/remotes/origin/pull/$CIRCLE_PR_NUMBER
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
# Fetch from fork if applicable
if [ -z $CIRCLE_PR_NUMBER ] ; then
git fetch --force --depth 1 origin +refs/pull/$CIRCLE_PR_NUMBER/head:refs/remotes/origin/pull/$CIRCLE_PR_NUMBER
fi
if [ -z $CIRCLE_BRANCH ] ; then
git checkout --force -B "$CIRCLE_BRANCH" "$CIRCLE_SHA1"
else
git checkout main
fi
# Checkout with cache, on machines that are using Docker the cache is ignored
checkout_code_with_cache:
Expand Down

0 comments on commit 0843c56

Please sign in to comment.