fix: bug with force pushed commits
This commit is contained in:
parent
d82ceda8a1
commit
8281b8ad57
@ -190,6 +190,7 @@ runs:
|
|||||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||||
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
GITHUB_PULL_REQUEST_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||||
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
|
GITHUB_EVENT_BEFORE: ${{ github.event.before }}
|
||||||
|
GITHUB_EVENT_FORCED : ${{ github.event.forced }}
|
||||||
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
# INPUT_<VARIABLE_NAME> is not available in Composite run steps
|
||||||
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
|
||||||
INPUT_SHA: ${{ steps.sha.outputs.sha }}
|
INPUT_SHA: ${{ steps.sha.outputs.sha }}
|
||||||
|
@ -62,10 +62,13 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||||||
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
|
CURRENT_BRANCH=$TARGET_BRANCH && exit_status=$? || exit_status=$?
|
||||||
|
|
||||||
if [[ -z $INPUT_BASE_SHA ]]; then
|
if [[ -z $INPUT_BASE_SHA ]]; then
|
||||||
|
PREVIOUS_SHA=""
|
||||||
|
|
||||||
|
if [[ "$GITHUB_EVENT_FORCED" != "true" ]]; then
|
||||||
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
|
PREVIOUS_SHA=$GITHUB_EVENT_BEFORE
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
if [[ -z "$PREVIOUS_SHA" || "$PREVIOUS_SHA" == "0000000000000000000000000000000000000000" ]]; then
|
||||||
echo "::debug::First commit detected"
|
|
||||||
PREVIOUS_SHA=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)")
|
PREVIOUS_SHA=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user