updated get-base-sha.sh
This commit is contained in:
parent
7de6088904
commit
b50afacfed
@ -158,6 +158,7 @@ runs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_WORKSPACE: ${{ github.workspace }}
|
GITHUB_WORKSPACE: ${{ github.workspace }}
|
||||||
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_SINCE: ${{ inputs.since }}
|
INPUT_SINCE: ${{ inputs.since }}
|
||||||
|
@ -22,10 +22,13 @@ if [[ -n "$INPUT_SINCE" ]]; then
|
|||||||
elif [[ -n "$INPUT_BASE_SHA" ]]; then
|
elif [[ -n "$INPUT_BASE_SHA" ]]; then
|
||||||
echo "::set-output name=base_sha::$INPUT_BASE_SHA"
|
echo "::set-output name=base_sha::$INPUT_BASE_SHA"
|
||||||
elif [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
|
elif [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then
|
||||||
LAST_REMOTE_COMMIT="$GITHUB_EVENT_BEFORE"
|
LAST_REMOTE_COMMIT=""
|
||||||
|
|
||||||
|
if [[ "$GITHUB_EVENT_FORCED" == "false" ]]; then
|
||||||
|
LAST_REMOTE_COMMIT=$GITHUB_EVENT_BEFORE
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z "$LAST_REMOTE_COMMIT" || "$LAST_REMOTE_COMMIT" == "0000000000000000000000000000000000000000" ]]; then
|
if [[ -z "$LAST_REMOTE_COMMIT" || "$LAST_REMOTE_COMMIT" == "0000000000000000000000000000000000000000" ]]; then
|
||||||
echo "::debug::First commit detected"
|
|
||||||
LAST_REMOTE_COMMIT=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)")
|
LAST_REMOTE_COMMIT=$(git rev-parse "$(git branch -r --sort=-committerdate | head -1 | xargs)")
|
||||||
fi
|
fi
|
||||||
if [[ "$INPUT_SHA" == "$LAST_REMOTE_COMMIT" ]]; then
|
if [[ "$INPUT_SHA" == "$LAST_REMOTE_COMMIT" ]]; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user