mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-17 13:47:20 +00:00
Fixed bug retrieving the first commit of a pull request
This commit is contained in:
parent
983dfd764c
commit
1e6b143073
1 changed files with 3 additions and 1 deletions
|
@ -111,7 +111,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
||||||
PREVIOUS_SHA=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)")
|
PREVIOUS_SHA=$CURRENT_SHA
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
|
if [[ "$PREVIOUS_SHA" == "$CURRENT_SHA" ]]; then
|
||||||
|
@ -119,6 +119,8 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
||||||
INITIAL_COMMIT="true"
|
INITIAL_COMMIT="true"
|
||||||
PREVIOUS_SHA=$(git rev-parse "$CURRENT_SHA")
|
PREVIOUS_SHA=$(git rev-parse "$CURRENT_SHA")
|
||||||
echo "::warning::Initial commit detected no previous commit found."
|
echo "::warning::Initial commit detected no previous commit found."
|
||||||
|
else
|
||||||
|
PREVIOUS_SHA=$(git rev-parse "$PREVIOUS_SHA^1")
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [[ -z "$PREVIOUS_SHA" ]]; then
|
if [[ -z "$PREVIOUS_SHA" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue