Skip to content

Commit

Permalink
fix: Error with multiple changed files from merge commits
Browse files Browse the repository at this point in the history
Fixes: #355
  • Loading branch information
jackton1 committed Feb 12, 2022
1 parent d498276 commit 269ccae
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fi
echo "Getting HEAD info..."

if [[ -z $INPUT_SHA ]]; then
CURRENT_SHA=$(git rev-parse HEAD 2>&1) && exit_status=$? || exit_status=$?
CURRENT_SHA=$(git rev-list --no-merges -n 1 HEAD 2>&1) && exit_status=$? || exit_status=$?
else
CURRENT_SHA=$INPUT_SHA && exit_status=$? || exit_status=$?
fi
Expand All @@ -52,7 +52,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
CURRENT_BRANCH=$TARGET_BRANCH

if [[ -z $INPUT_BASE_SHA ]]; then
PREVIOUS_SHA=$(git rev-parse HEAD^1 2>&1) && exit_status=$? || exit_status=$?
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 HEAD^1 2>&1) && exit_status=$? || exit_status=$?
else
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
Expand All @@ -72,7 +72,7 @@ else

if [[ -z $INPUT_BASE_SHA ]]; then
git fetch --no-tags -u --progress --depth=1 temp_changed_files "${TARGET_BRANCH}":"${TARGET_BRANCH}" && exit_status=$? || exit_status=$?
PREVIOUS_SHA=$(git rev-parse "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
PREVIOUS_SHA=$(git rev-list --no-merges -n 1 "${TARGET_BRANCH}" 2>&1) && exit_status=$? || exit_status=$?
else
git fetch --no-tags -u --progress --depth=1 temp_changed_files "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$?
PREVIOUS_SHA=$INPUT_BASE_SHA
Expand Down

0 comments on commit 269ccae

Please sign in to comment.