Skip to content

Commit

Permalink
Merge pull request #624 from tj-actions/fix/bug-since_last_remote_com…
Browse files Browse the repository at this point in the history
…mit-does-not-work-in-v2904

fix: bug with last remote commit sha
  • Loading branch information
jackton1 committed Sep 13, 2022
2 parents cc8c5e7 + e3b5eb7 commit c5c9b6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion action.yml
Expand Up @@ -165,7 +165,10 @@ runs:
elif [[ -n "${{ inputs.base_sha }}" ]]; then
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" ]]; then
LAST_REMOTE_COMMIT=$(git rev-parse $(git branch -r --sort=-committerdate | head -1))
LAST_REMOTE_COMMIT="${{ github.event.before }}"
if [[ -z "$LAST_REMOTE_COMMIT" ]]; then
LAST_REMOTE_COMMIT=$(git rev-parse $(git branch -r --sort=-committerdate | head -1))
fi
if [[ "${{ inputs.sha }}" == "$LAST_REMOTE_COMMIT" ]]; then
LAST_REMOTE_COMMIT=$(git rev-parse "${{ inputs.sha }}^1")
fi
Expand Down

0 comments on commit c5c9b6f

Please sign in to comment.