From d66098e3dd7c3eacb1ad679b635cfa6d285beec0 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Wed, 2 Nov 2022 15:09:50 -0600 Subject: [PATCH 01/12] chore: update test --- .github/workflows/test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 415bfc51..d4df3817 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -338,13 +338,14 @@ jobs: max-parallel: 4 matrix: platform: [ubuntu-latest, ubuntu-22.04, windows-latest, macos-latest, macos-11, ubuntu-18.04, windows-2022] + fetch-depth: [0, 1] steps: - name: Checkout uses: actions/checkout@v3 with: submodules: true - fetch-depth: 0 + fetch-depth: ${{ matrix.fetch-depth }} - name: Dump GitHub context env: GITHUB_CONTEXT: ${{ toJson(github) }} From e2bb33a27822b8b64f97aac376526aa1c947f469 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 11:04:53 -0600 Subject: [PATCH 02/12] Updated debug message. --- diff-sha.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 5b3661fa..a7e42534 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -61,7 +61,7 @@ git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_ if [[ $exit_status -ne 0 ]]; then echo "::error::Unable to locate the current sha: $CURRENT_SHA" - echo "::error::You seem to be missing 'fetch-depth: 0' or 'fetch-depth: 2'. See https://github.com/tj-actions/changed-files#usage" + echo "::error::Please verify that current sha is valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." exit 1 else echo "::debug::Current SHA: $CURRENT_SHA" @@ -125,7 +125,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then if [[ $exit_status -ne 0 ]]; then echo "::error::Unable to locate the previous sha: $PREVIOUS_SHA" - echo "::error::Please verify that both commit are valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that the previous sha commit is valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." exit 1 fi else @@ -156,14 +156,14 @@ else if [[ $exit_status -ne 0 ]]; then echo "::error::Unable to locate the previous sha: $PREVIOUS_SHA" - echo "::error::Please verify that both commit are valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." exit 1 fi fi if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" && "$INITIAL_COMMIT" == "false" ]]; then echo "::error::Similar commit hashes detected: previous sha: $PREVIOUS_SHA is equivalent to the current sha: $CURRENT_SHA." - echo "::error::Please verify that both commit are valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that both commits are valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." exit 1 fi From b8094dc31e019229cf4f81f713c67c1a01e28ac3 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 11:31:52 -0600 Subject: [PATCH 03/12] Update fetch_depth --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2031e1ad..84753ab7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -411,6 +411,7 @@ jobs: with: base_sha: d1c0ee4 sha: 4d04215 + fetch_depth: 60000 dir_names: "true" - name: Show output run: | @@ -502,6 +503,7 @@ jobs: with: base_sha: d1c0ee4 sha: 4d04215 + fetch_depth: 60000 include_all_old_new_renamed_files: true - name: Show output run: | @@ -521,6 +523,7 @@ jobs: with: base_sha: 4d04215 sha: fe238e6 + fetch_depth: 60000 include_all_old_new_renamed_files: true - name: Show output run: | From 902daca59253d52f00ceacdb4517c69f5a799ac0 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 11:33:33 -0600 Subject: [PATCH 04/12] Updated debug message. --- diff-sha.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index a7e42534..cb05a568 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -61,7 +61,7 @@ git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_ if [[ $exit_status -ne 0 ]]; then echo "::error::Unable to locate the current sha: $CURRENT_SHA" - echo "::error::Please verify that current sha is valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that current sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." exit 1 else echo "::debug::Current SHA: $CURRENT_SHA" @@ -125,7 +125,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then if [[ $exit_status -ne 0 ]]; then echo "::error::Unable to locate the previous sha: $PREVIOUS_SHA" - echo "::error::Please verify that the previous sha commit is valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that the previous sha commit is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." exit 1 fi else @@ -156,14 +156,14 @@ else if [[ $exit_status -ne 0 ]]; then echo "::error::Unable to locate the previous sha: $PREVIOUS_SHA" - echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that the previous sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." exit 1 fi fi if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" && "$INITIAL_COMMIT" == "false" ]]; then echo "::error::Similar commit hashes detected: previous sha: $PREVIOUS_SHA is equivalent to the current sha: $CURRENT_SHA." - echo "::error::Please verify that both commits are valid, and increase the fetch_depth to a number higher than $INPUT_INPUT_FETCH_DEPTH." + echo "::error::Please verify that both commits are valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." exit 1 fi From 6a28d55cbf7c6e71a5ae376ffce47e74537386e8 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 11:45:56 -0600 Subject: [PATCH 05/12] Updated diff-sha.sh --- diff-sha.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/diff-sha.sh b/diff-sha.sh index cb05a568..98ed42bc 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -112,6 +112,8 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi fi else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + PREVIOUS_SHA=$INPUT_BASE_SHA TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH From a8965747f251a4a542c76487ad77760733751946 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 11:47:33 -0600 Subject: [PATCH 06/12] Updated diff-sha.sh --- diff-sha.sh | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 98ed42bc..891d34ed 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -72,6 +72,8 @@ if [[ -z $GITHUB_BASE_REF ]]; then TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$? + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + if [[ -z $INPUT_BASE_SHA ]]; then if [[ -n "$INPUT_SINCE" ]]; then echo "::debug::Getting base SHA for '$INPUT_SINCE'..." @@ -82,8 +84,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then exit 1 fi else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" - PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then @@ -112,8 +112,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi fi else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" - PREVIOUS_SHA=$INPUT_BASE_SHA TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH @@ -135,18 +133,16 @@ else TARGET_BRANCH=$GITHUB_BASE_REF CURRENT_BRANCH=$GITHUB_HEAD_REF - if [[ -z $INPUT_BASE_SHA ]]; then - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" - git fetch --no-tags -u --progress --deepen=40000 + git fetch --no-tags -u --progress --deepen=40000 + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + if [[ -z $INPUT_BASE_SHA ]]; then PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then PREVIOUS_SHA=$GITHUB_EVENT_PULL_REQUEST_BASE_SHA && exit_status=$? || exit_status=$? fi echo "::debug::Previous SHA: $PREVIOUS_SHA" else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$? - git fetch --no-tags -u --progress --deepen=40000 PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$? fi From 62aef87f399ebe7787f227f1d53e17a089874097 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 12:08:29 -0600 Subject: [PATCH 07/12] Updated diff-sha.sh --- diff-sha.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 891d34ed..0f953c85 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -72,8 +72,6 @@ if [[ -z $GITHUB_BASE_REF ]]; then TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$? - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" - if [[ -z $INPUT_BASE_SHA ]]; then if [[ -n "$INPUT_SINCE" ]]; then echo "::debug::Getting base SHA for '$INPUT_SINCE'..." @@ -84,6 +82,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then exit 1 fi else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then @@ -112,6 +111,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi fi else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" PREVIOUS_SHA=$INPUT_BASE_SHA TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH From bfe077bfb660393b4ca22f6b52d43ed55999b9d5 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 12:29:02 -0600 Subject: [PATCH 08/12] Updated diff-sha.sh --- diff-sha.sh | 87 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 58 insertions(+), 29 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index 0f953c85..a99be2a1 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -38,40 +38,40 @@ else echo "Valid git version found: ($GIT_VERSION)" fi -echo "::debug::Getting HEAD SHA..." - -if [[ -n "$INPUT_UNTIL" ]]; then - echo "::debug::Getting HEAD SHA for '$INPUT_UNTIL'..." - CURRENT_SHA=$(git log -1 --format="%H" --date=local --until="$INPUT_UNTIL") && exit_status=$? || exit_status=$? - - if [[ $exit_status -ne 0 ]]; then - echo "::error::Invalid until date: $INPUT_UNTIL" - exit 1 - fi -else - if [[ -z $INPUT_SHA ]]; then - CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$? - else - CURRENT_SHA=$INPUT_SHA; exit_status=$? - fi -fi - -echo "::debug::Verifying the current commit SHA: $CURRENT_SHA" -git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$? - -if [[ $exit_status -ne 0 ]]; then - echo "::error::Unable to locate the current sha: $CURRENT_SHA" - echo "::error::Please verify that current sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." - exit 1 -else - echo "::debug::Current SHA: $CURRENT_SHA" -fi - if [[ -z $GITHUB_BASE_REF ]]; then echo "Running on a push event..." TARGET_BRANCH=${GITHUB_REF/refs\/heads\//} && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$? + echo "::debug::Getting HEAD SHA..." + if [[ -n "$INPUT_UNTIL" ]]; then + echo "::debug::Getting HEAD SHA for '$INPUT_UNTIL'..." + CURRENT_SHA=$(git log -1 --format="%H" --date=local --until="$INPUT_UNTIL") && exit_status=$? || exit_status=$? + + if [[ $exit_status -ne 0 ]]; then + echo "::error::Invalid until date: $INPUT_UNTIL" + exit 1 + fi + else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + if [[ -z $INPUT_SHA ]]; then + CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$? + else + CURRENT_SHA=$INPUT_SHA; exit_status=$? + fi + fi + + echo "::debug::Verifying the current commit SHA: $CURRENT_SHA" + git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$? + + if [[ $exit_status -ne 0 ]]; then + echo "::error::Unable to locate the current sha: $CURRENT_SHA" + echo "::error::Please verify that current sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." + exit 1 + else + echo "::debug::Current SHA: $CURRENT_SHA" + fi + if [[ -z $INPUT_BASE_SHA ]]; then if [[ -n "$INPUT_SINCE" ]]; then echo "::debug::Getting base SHA for '$INPUT_SINCE'..." @@ -133,9 +133,38 @@ else TARGET_BRANCH=$GITHUB_BASE_REF CURRENT_BRANCH=$GITHUB_HEAD_REF + echo "Fetching remote refs..." git fetch --no-tags -u --progress --deepen=40000 git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + echo "::debug::Getting HEAD SHA..." + if [[ -n "$INPUT_UNTIL" ]]; then + echo "::debug::Getting HEAD SHA for '$INPUT_UNTIL'..." + CURRENT_SHA=$(git log -1 --format="%H" --date=local --until="$INPUT_UNTIL") && exit_status=$? || exit_status=$? + + if [[ $exit_status -ne 0 ]]; then + echo "::error::Invalid until date: $INPUT_UNTIL" + exit 1 + fi + else + if [[ -z $INPUT_SHA ]]; then + CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$? + else + CURRENT_SHA=$INPUT_SHA; exit_status=$? + fi + fi + + echo "::debug::Verifying the current commit SHA: $CURRENT_SHA" + git rev-parse --quiet --verify "$CURRENT_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$? + + if [[ $exit_status -ne 0 ]]; then + echo "::error::Unable to locate the current sha: $CURRENT_SHA" + echo "::error::Please verify that current sha is valid, and increase the fetch_depth to a number higher than $INPUT_FETCH_DEPTH." + exit 1 + else + echo "::debug::Current SHA: $CURRENT_SHA" + fi + if [[ -z $INPUT_BASE_SHA ]]; then PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then From b4b4b40c0326a9b4133323aab631f5971c996c16 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 12:32:34 -0600 Subject: [PATCH 09/12] Updated diff-sha.sh --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index a99be2a1..41f6fed8 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -53,10 +53,10 @@ if [[ -z $GITHUB_BASE_REF ]]; then exit 1 fi else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" if [[ -z $INPUT_SHA ]]; then CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$? else + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" CURRENT_SHA=$INPUT_SHA; exit_status=$? fi fi From 3351aa00b2fb67b2d14827f16877261b704ef8c9 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 15:12:56 -0600 Subject: [PATCH 10/12] Update diff-sha.sh --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 41f6fed8..33a9a827 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -set -euo pipefail +set -exuo pipefail INITIAL_COMMIT="false" GITHUB_OUTPUT=${GITHUB_OUTPUT:-""} From 68efb13b02b737dcdc01e55bae9b65955f377445 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 17:06:45 -0600 Subject: [PATCH 11/12] Updated test --- diff-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/diff-sha.sh b/diff-sha.sh index 33a9a827..df6025e4 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -56,7 +56,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then if [[ -z $INPUT_SHA ]]; then CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$? else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH":"$CURRENT_BRANCH" CURRENT_SHA=$INPUT_SHA; exit_status=$? fi fi From 807520bd145ea265b13d276816ed6fb2673b7887 Mon Sep 17 00:00:00 2001 From: Tonye Jack Date: Thu, 3 Nov 2022 17:30:38 -0600 Subject: [PATCH 12/12] Updated test --- diff-sha.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/diff-sha.sh b/diff-sha.sh index df6025e4..91332d76 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -56,7 +56,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then if [[ -z $INPUT_SHA ]]; then CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$? else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$CURRENT_BRANCH":"$CURRENT_BRANCH" + git fetch --no-tags -u --progress --deepen="$INPUT_FETCH_DEPTH" CURRENT_SHA=$INPUT_SHA; exit_status=$? fi fi @@ -82,7 +82,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then exit 1 fi else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + git fetch --no-tags -u --progress --deepen="$INPUT_FETCH_DEPTH" PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$? if [[ -z "$PREVIOUS_SHA" ]]; then @@ -111,7 +111,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi fi else - git fetch --no-tags -u --progress --depth="$INPUT_FETCH_DEPTH" origin "$TARGET_BRANCH":"$TARGET_BRANCH" + git fetch --no-tags -u --progress --deepen="$INPUT_FETCH_DEPTH" PREVIOUS_SHA=$INPUT_BASE_SHA TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$? CURRENT_BRANCH=$TARGET_BRANCH