mirror of
https://github.com/tj-actions/changed-files
synced 2025-02-19 15:23:42 +00:00
Fixed regression bug with base_sha for pull_request (#278)
* Fixed regression bug with base_sha for pull_request Fixes: #276 * Update action.yml * Update entrypoint.sh * Update entrypoint.sh * Update entrypoint.sh * Update entrypoint.sh
This commit is contained in:
parent
922308f3c8
commit
188487d180
2 changed files with 9 additions and 5 deletions
10
action.yml
10
action.yml
|
@ -98,10 +98,12 @@ runs:
|
|||
# "Set base sha..."
|
||||
if [[ -n "${{ inputs.base_sha }}" ]]; then
|
||||
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event_name }}" == "pull_request" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.pull_request.base.sha }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event_name }}" == "push" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.before }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" ]]; then
|
||||
if [[ "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.before }}"
|
||||
else
|
||||
echo "::set-output name=base_sha::${{ github.sha }}"
|
||||
fi
|
||||
fi
|
||||
id: base-sha
|
||||
shell: bash
|
||||
|
|
|
@ -56,6 +56,7 @@ if [[ -z $GITHUB_BASE_REF ]]; then
|
|||
PREVIOUS_SHA=$(git rev-parse HEAD^1 2>&1) && exit_status=$? || exit_status=$?
|
||||
else
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA && exit_status=$? || exit_status=$?
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
fi
|
||||
|
||||
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||
|
@ -76,8 +77,9 @@ else
|
|||
else
|
||||
git fetch --no-tags -u --progress --depth=1 temp_changed_files "$INPUT_BASE_SHA" && exit_status=$? || exit_status=$?
|
||||
PREVIOUS_SHA=$INPUT_BASE_SHA
|
||||
TARGET_BRANCH=$(git name-rev --name-only "$PREVIOUS_SHA" 2>&1) && exit_status=$? || exit_status=$?
|
||||
fi
|
||||
|
||||
|
||||
git rev-parse --quiet --verify "$PREVIOUS_SHA^{commit}" 1>/dev/null 2>&1 && exit_status=$? || exit_status=$?
|
||||
|
||||
if [[ $exit_status -ne 0 ]]; then
|
||||
|
|
Loading…
Add table
Reference in a new issue