Skip to content

Commit

Permalink
fix: bug detecting initial commits
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Oct 31, 2022
1 parent d24b4c4 commit a5eb308
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions diff-sha.sh
Expand Up @@ -115,9 +115,9 @@ if [[ -z $GITHUB_BASE_REF ]]; then
fi

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"
PREVIOUS_SHA=$(git rev-parse "$CURRENT_SHA")
echo "::warning::Initial commit detected no previous commit found."
Expand Down

0 comments on commit a5eb308

Please sign in to comment.