3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-02-19 15:23:42 +00:00

fix: bug with last remote commit sha

This commit is contained in:
Tonye Jack 2022-09-12 22:04:33 -06:00 committed by GitHub
parent cc8c5e7787
commit e3b5eb746a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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