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

[BUG] changes based on last remote commit fail after rebasing #546

Closed
3 tasks done
thearchitector opened this issue Jul 15, 2022 · 2 comments · Fixed by #583
Closed
3 tasks done

[BUG] changes based on last remote commit fail after rebasing #546

thearchitector opened this issue Jul 15, 2022 · 2 comments · Fixed by #583
Labels
bug Something isn't working

Comments

@thearchitector
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Does this issue exist in the latest version?

  • I'm using the latest release

Describe the bug?

A fairly common pattern in PRs is to rebase commits before merging, which might mean that the remote history gets erased/overwritten after a force push.

If the action is configured to calculate changes with since_last_remote_commit: "true", the action fails after a rebase force push indicating the commit no longer exists.

To Reproduce

  1. Commit a few commits to a PR (git commit x 3 + git push)
  2. Rebase and reword an old commit (git rebase -i HEAD~3)
  3. Force push (git push -f)

What OS are you seeing the problem on?

ubuntu-latest or ubuntu-20.04

Expected behavior?

I would expect / hope for the last valid remote commit to get recalculated based on the commits overwritten in the rebase.

sha 01 (remote)
--
sha 23 (new)
sha 45 (new)

last_remote_commit = 01

after rebase:

sha 01 (remote)
--
sha 67 (new)
sha 89 (new)

last_remote_commit = 01 NOT 45

Relevant log output

Error: Unable to locate the previous sha: 4242714b9997c0c6a32e6e0f7d9a25913d741360
Error: You seem to be missing 'fetch-depth: 0' or 'fetch-depth: 2'. See https://github.com/tj-actions/changed-files#usage
Error: Process completed with exit code 1.

Anything else?

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@thearchitector thearchitector added the bug Something isn't working label Jul 15, 2022
@github-actions
Copy link
Contributor

Thanks for reporting this issue, don't forget to star this project to help us reach a wider audience.

This was linked to pull requests Aug 12, 2022
@jackton1
Copy link
Member

jackton1 commented Aug 17, 2022

@thearchitector The fix is now available in the latest release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants