3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2024-12-17 03:47:20 +00:00

fix: re-add ability to change the max fetch depth

This commit is contained in:
Tonye Jack 2022-11-08 12:45:25 -07:00
parent 6a9cc33099
commit 67230d6de5
2 changed files with 6 additions and 1 deletions

View file

@ -81,6 +81,10 @@ inputs:
description: "Limit depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
required: false
default: "40"
max_fetch_depth:
description: "Maximum depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history."
required: false
default: "5000"
since_last_remote_commit:
description: "Use the last commit on the remote branch as the `base_sha`. Defaults to the last non merge commit on the target branch for pull request events and the previous commit of the current branch for push events."
required: true
@ -177,6 +181,7 @@ runs:
INPUT_UNTIL: ${{ inputs.until }}
INPUT_PATH: ${{ inputs.path }}
INPUT_FETCH_DEPTH: ${{ inputs.fetch_depth }}
INPUT_MAX_FETCH_DEPTH: ${{ inputs.max_fetch_depth }}
INPUT_SINCE_LAST_REMOTE_COMMIT: ${{ inputs.since_last_remote_commit }}
- name: Glob match
uses: tj-actions/glob@v16

View file

@ -159,7 +159,7 @@ else
# shellcheck disable=SC2086
git fetch $EXTRA_ARGS --deepen="$depth" origin "$TARGET_BRANCH" HEAD;
depth=$((depth * 10))
max_depth=5000
max_depth=$INPUT_MAX_FETCH_DEPTH
if [[ $depth -gt $max_depth ]]; then
echo "::error::Unable to find merge-base between $TARGET_BRANCH and HEAD."