Skip to content

Commit

Permalink
fix: bug force pushing commits after a rebase (#583)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackton1 committed Aug 17, 2022
1 parent 257f37d commit 5e56dca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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

Expand Down
9 changes: 7 additions & 2 deletions action.yml
Expand Up @@ -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
Expand Down

0 comments on commit 5e56dca

Please sign in to comment.