diff --git a/diff-sha.sh b/diff-sha.sh index 812c105b..c07ae21d 100644 --- a/diff-sha.sh +++ b/diff-sha.sh @@ -70,8 +70,12 @@ if [[ -z $GITHUB_BASE_REF ]]; then fi if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then - INITIAL_COMMIT="true" - echo "::debug::Initial commit detected" + PREVIOUS_SHA=$(git rev-parse "$CURRENT_SHA^1") + + if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then + INITIAL_COMMIT="true" + echo "::debug::Initial commit detected" + fi fi else PREVIOUS_SHA=$INPUT_BASE_SHA