From 30b9252953b1451f1d0964e563f3440936a2a13f Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 17 Nov 2022 08:16:17 -0700 Subject: [PATCH] Updated diff-sha.sh --- action.yml | 2 +- diff-sha.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/action.yml b/action.yml index 8be22421..160846a6 100644 --- a/action.yml +++ b/action.yml @@ -80,7 +80,7 @@ inputs: fetch_depth: description: "Initial depth of the branch history fetched. **NOTE**: This can be adjusted to resolve errors with insufficient history." required: false - default: "10" + 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 diff --git a/diff-sha.sh b/diff-sha.sh index 9ddfb9c0..69a0d9e9 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -191,7 +191,7 @@ else PREVIOUS_SHA=$(git rev-parse $(git branch -r --sort=-committerdate | head -1) 2>&1) && exit_status=$? || exit_status=$? fi else - PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? + PREVIOUS_SHA=$(git merge-base --fork-point "$CURRENT_BRANCH" "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? fi if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then