actions-js / push

⬆️ Push changes made by actions right back into the current repository.
MIT License
89 stars 51 forks source link

Is this possible to include git pull --rebase before push? #13

Closed bdovh closed 6 months ago

bdovh commented 2 years ago

We have often several CI jobs invoked simultaneously, and the first one executes succesfully while the second one fails

hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/actions-js/push/master/start.js:9:19)
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:[16](https://github.com/LinkSquares/salesforce-finalize/actions/runs/3319940082/jobs/5485720915#step:9:17))
    at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5) {
  code: 1
}
Error: Invalid status code: 1
    at ChildProcess.<anonymous> (/home/runner/work/_actions/actions-js/push/master/start.js:9:[19](https://github.com/LinkSquares/salesforce-finalize/actions/runs/3319940082/jobs/5485720915#step:9:20))
    at ChildProcess.emit (node:events:390:28)
    at maybeClose (node:internal/child_process:1064:16)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:[30](https://github.com/LinkSquares/salesforce-finalize/actions/runs/3319940082/jobs/5485720915#step:9:31)1:5)

If we could just perform git pull --rebase or any pull, it would partially solve this problem unless there are conflicts. At least for the case when there are no conflicts, I would prefer my CI not to fail. I can fork this repo and create a PR with a fix

devenes commented 2 years ago

I am agreed, it can be fixed.

bdovh commented 2 years ago

@devenes My implementation is quite naive https://github.com/actions-js/push/pull/14/files - you may decide if you would like to hide it under configuration parameter or something like that

devenes commented 1 year ago

Thanks for working on this issue @bdovh. I am sure it will be very useful. I'm so excited to use this feature! We can define an option for use.