diff --git a/diff-sha.sh b/diff-sha.sh index e1fc62eb..fe7b6a00 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -115,9 +115,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then - PARENT_COUNT=$(git show -s --format="%P" "$CURRENT_SHA" | wc -w | xargs) - - if [[ "$PARENT_COUNT" == "0" ]]; then + if ! git rev-parse "$PREVIOUS_SHA^1" &>/dev/null; then INITIAL_COMMIT="true" PREVIOUS_SHA=$(git rev-parse "$CURRENT_SHA") echo "::warning::Initial commit detected no previous commit found."