Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bug force pushing commits after a rebase #583

Merged
merged 2 commits into from Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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