Skip to content
Closed
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
14 changes: 10 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ runs:
ref: ${{ inputs.base_ref }}
path: gitstream/repo/
token: ${{ fromJSON(fromJSON(inputs.client_payload)).githubToken || github.token }}
fetch-depth: 1

- name: Escape single quotes
id: safe-strings
Expand Down Expand Up @@ -129,12 +130,17 @@ runs:
- name: Checkout Pull Request branches history
if: ${{ env.SHOULD_CHECKOUT == 'true' }}
shell: bash
env:
# Use 1 for shallow fetch when SKIP_FULL_HISTORY is non‐empty,
# otherwise default to 2147483647 for effectively unlimited
DEPTH: ${{ env.SKIP_FULL_HISTORY && 1 || 2147483647 }}
run: |
ALL=2147483647
cd gitstream && cd repo
git fetch --deepen=$ALL origin $'${{ steps.safe-strings.outputs.base_ref }}'
cd gitstream/repo

# both origin and upstream use the same DEPTH
git fetch --deepen=$DEPTH origin $'${{ steps.safe-strings.outputs.base_ref }}'
git remote add upstream $'${{ steps.safe-strings.outputs.url }}'
git fetch --deepen=$ALL upstream $'${{ steps.safe-strings.outputs.head_ref }}'
git fetch --deepen=$DEPTH upstream $'${{ steps.safe-strings.outputs.head_ref }}'
git checkout -b $'upstream/${{ steps.safe-strings.outputs.head_ref}}' $'upstream/${{ steps.safe-strings.outputs.head_ref}}'
git checkout $'${{ steps.safe-strings.outputs.base_ref }}'
git checkout $'${{ steps.safe-strings.outputs.head_ref }}'
Expand Down
Loading