diff --git a/action.yml b/action.yml index a37893c1582..1c3078e8d3b 100644 --- a/action.yml +++ b/action.yml @@ -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