aormsby / Fork-Sync-With-Upstream-action

An action to automatically update your fork with new commits from the upstream repo
MIT License
258 stars 70 forks source link

sync failing on live run but tests pass #34

Closed tpletcher closed 3 years ago

tpletcher commented 3 years ago

Hi Folks,

Set up the sync action on a freshly forked repo, used your example yaml and ran in test mode with everything green. However, when I flip over to live mode, the sync is failing with this error (Full job run logs are attached):


Syncing new commits... 272 From https://github.com/fcsonline/drill 273

281 Error: The process '/usr/bin/sh' failed with exit code 128

1_Set up job.txt 2_Checkout target repo.txt 3_Sync upstream changes.txt 12_Post Checkout target repo.txt 13_Complete job.txt

aormsby commented 3 years ago

Hi @tpletcher, I took a look at all of your output, and I was able to recreate the problem. Your input is solid, and I think you've done everything correctly. I'm sure noticed that the generated list of new commits goes all the way back to that initial commit of the upstream repo.

Here's what's happening --

Speaking frankly, this is a minor weakness of the sync action because it was designed to work on a branch that you don't make any commits on. However, you have some options to fix this --

  1. Set => upstream_pull_args: '--allow-unrelated-histories' to allow the merge to continue as shown in the wiki (I even added more details based on your issue). This change should also allow you to make your own commits to the master branch (but keep in mind you may need to add further input to manage merge conflicts). Adding this input would solve your problem immediately.
  2. If you only intend to use this action for super simple syncs... honestly, you could just use the new built-in 'Fetch upstream' option that Github added to forked repos. The simplest solution is always the best solution, after all. Food for thought.
Screen Shot 2021-09-18 at 2 27 31 PM

I hope this helps, and I hope you can get beyond this roadblock. Please close this issue if either solution works for you. Happy coding!

tpletcher commented 3 years ago

Thanks! Makes sense. I'm really just looking to keep the fork sync'd to upstream so that "Fetch Upstream" should be fine. Appreciate the detailed response, have a great day.