Skip to content

Commit

Permalink
Merge pull request #663 from tj-actions/chore/fix-bug-with-base-sha
Browse files Browse the repository at this point in the history
chore: fix bug with base sha
  • Loading branch information
jackton1 committed Oct 2, 2022
2 parents dc786e7 + 02c9951 commit 4dd77eb
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions get-base-sha.sh
Expand Up @@ -21,18 +21,4 @@ if [[ -n "$INPUT_SINCE" ]]; then
echo "::set-output name=base_sha::$BASE_SHA"
elif [[ -n "$INPUT_BASE_SHA" ]]; then
echo "::set-output name=base_sha::$INPUT_BASE_SHA"
elif [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
LAST_REMOTE_COMMIT=""

if [[ "$GITHUB_EVENT_FORCED" == "false" ]]; then
LAST_REMOTE_COMMIT=$GITHUB_EVENT_BEFORE
fi

if [[ -z "$LAST_REMOTE_COMMIT" || "$LAST_REMOTE_COMMIT" == "0000000000000000000000000000000000000000" ]]; then
LAST_REMOTE_COMMIT=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)")
fi
if [[ "$INPUT_SHA" == "$LAST_REMOTE_COMMIT" ]]; then
LAST_REMOTE_COMMIT=$(git rev-parse "$INPUT_SHA"^1)
fi
echo "::set-output name=base_sha::$LAST_REMOTE_COMMIT"
fi

0 comments on commit 4dd77eb

Please sign in to comment.