Skip to content

Commit

Permalink
fix: bug with force pushing commits to pr branches
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Nov 8, 2022
1 parent e062ae8 commit 420a779
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions diff-sha.sh
Expand Up @@ -198,10 +198,10 @@ else

if [[ -z $INPUT_BASE_SHA ]]; then
if [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
PREVIOUS_SHA=""
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE

if [[ "$GITHUB_EVENT_FORCED" == "false" || -z "$GITHUB_EVENT_FORCED" ]]; then
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
if ! git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1; then
PREVIOUS_SHA=$(git rev-list -n 1 "$TARGET_BRANCH" 2>&1) && exit_status=$? || exit_status=$?
fi

if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
Expand Down

0 comments on commit 420a779

Please sign in to comment.