Merge pull request #624 from tj-actions/fix/bug-since_last_remote_commit-does-not-work-in-v2904

fix: bug with last remote commit sha
This commit is contained in:
Tonye Jack
2022-09-12 22:34:47 -06:00
committed by GitHub

View File

@@ -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