diff --git a/action.yml b/action.yml index 4c548769..b1824a0f 100644 --- a/action.yml +++ b/action.yml @@ -50,6 +50,10 @@ inputs: base_sha: description: "Specify a base commit SHA on used for comparing changes" required: false + since_last_remote_commit: + description: "Use the last commit on the remote branch as the base_sha for push event." + required: false + default: "false" since: description: "Get changed files for commits whose timestamp is older than the given time" required: false @@ -160,6 +164,7 @@ runs: INPUT_BASE_SHA: ${{ inputs.base_sha }} INPUT_SHA: ${{ inputs.sha }} INPUT_PATH: ${{ inputs.path }} + INPUT_SINCE_LAST_REMOTE_COMMIT: ${{ inputs.since_last_remote_commit }} - run: | # "Calculate the sha..." bash $GITHUB_ACTION_PATH/get-sha.sh diff --git a/get-base-sha.sh b/get-base-sha.sh index 9cd65e77..e9424043 100644 --- a/get-base-sha.sh +++ b/get-base-sha.sh @@ -21,7 +21,7 @@ if [[ -n "$INPUT_SINCE" ]]; then echo "::set-output name=base_sha::$BASE_SHA" elif [[ -n "$INPUT_BASE_SHA" ]]; then echo "::set-output name=base_sha::$INPUT_BASE_SHA" -else +elif [[ "$INPUT_SINCE_LAST_REMOTE_COMMIT" == "true" ]]; then LAST_REMOTE_COMMIT="$GITHUB_EVENT_BEFORE" if [[ -z "$LAST_REMOTE_COMMIT" || "$LAST_REMOTE_COMMIT" == "0000000000000000000000000000000000000000" ]]; then