fix: bug detecting initial commits

This commit is contained in:
Tonye Jack 2022-10-30 20:28:12 -06:00
parent d24b4c4320
commit a5eb308eb7

View File

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