mirror of
https://github.com/tj-actions/changed-files
synced 2024-12-16 09:27:57 +00:00
fix: bug force pushing commits after a rebase (#583)
This commit is contained in:
parent
257f37d700
commit
5e56dcabdd
2 changed files with 8 additions and 3 deletions
|
@ -13,7 +13,7 @@
|
|||
|
||||
## changed-files
|
||||
|
||||
Retrieve all changed files and directories relative to the target branch (`pull_request*` based events) or the last remote commit (`push` based event) returning the **absolute path** to all changed files and directories from root of the project.
|
||||
Retrieve all changed files and directories relative to the target branch (`pull_request*` based events) or the last remote commit (`push` based event) returning the **absolute path** to all changed files and directories from the project root.
|
||||
|
||||
## Features
|
||||
|
||||
|
|
|
@ -154,8 +154,13 @@ 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.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.before }}"
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event.forced }}" == "true" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
LAST_REMOTE_COMMIT=$(git rev-parse $(git branch -r --sort=-committerdate | head -1))
|
||||
if [[ "${{ inputs.sha }}" != "$LAST_REMOTE_COMMIT" ]]; then
|
||||
echo "::set-output name=base_sha::$LAST_REMOTE_COMMIT"
|
||||
fi
|
||||
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event.forced }}" != "true" && "${{ github.event.before }}" != "0000000000000000000000000000000000000000" ]]; then
|
||||
echo "::set-output name=base_sha::${{ github.event.before }}"
|
||||
fi
|
||||
id: base-sha
|
||||
shell: bash
|
||||
|
|
Loading…
Reference in a new issue