File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change 5252 ref : ${{ inputs.base_ref }}
5353 path : gitstream/repo/
5454 token : ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
55+ fetch-depth : 1
5556
5657 - name : Escape single quotes
5758 id : safe-strings
@@ -125,16 +126,21 @@ runs:
125126 ARTIFACT_OUTCOME_CM_REPO_ARG : ${{ steps.download-cache-for-cm-repo.outcome }}
126127 with :
127128 script : require('${{ github.action_path }}/scripts/check-cache-download-status')(core);
128-
129+
129130 - name : Checkout Pull Request branches history
130131 if : ${{ env.SHOULD_CHECKOUT == 'true' }}
131132 shell : bash
133+ env :
134+ # Use 1 for shallow fetch when SKIP_FULL_HISTORY is non‐empty,
135+ # otherwise default to 2147483647 for effectively unlimited
136+ DEPTH : ${{ env.SKIP_FULL_HISTORY && 1 || 2147483647 }}
132137 run : |
133- ALL=2147483647
134- cd gitstream && cd repo
135- git fetch --deepen=$ALL origin $'${{ steps.safe-strings.outputs.base_ref }}'
138+ cd gitstream/repo
139+
140+ # both origin and upstream use the same DEPTH
141+ git fetch --deepen=$DEPTH origin $'${{ steps.safe-strings.outputs.base_ref }}'
136142 git remote add upstream $'${{ steps.safe-strings.outputs.url }}'
137- git fetch --deepen=$ALL upstream $'${{ steps.safe-strings.outputs.head_ref }}'
143+ git fetch --deepen=$DEPTH upstream $'${{ steps.safe-strings.outputs.head_ref }}'
138144 git checkout -b $'upstream/${{ steps.safe-strings.outputs.head_ref}}' $'upstream/${{ steps.safe-strings.outputs.head_ref}}'
139145 git checkout $'${{ steps.safe-strings.outputs.base_ref }}'
140146 git checkout $'${{ steps.safe-strings.outputs.head_ref }}'
You can’t perform that action at this time.
0 commit comments