Diverging Paths when Auto-Committing in Parallel Jobs #290
-
Hi, I have a workflow with jobs like the following running in parallel:
Say that job-1 finishes first. Trying to generate the auto-commit in job-2 says that the paths have diverged since job-1 already made a commit to the branch, making the branch checked out in job-2 behind the remote. I was wondering what the best way forward would be? I could make the auto-commit action force-push using the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
What you certainly can do, is add a - name: Pull Remote Changes
run: git pull But I'm not this will work 100% of the time. By running jobs in parallel you're potentially creating a race-condition. Which commit should "win", if both commits are created in the same second? See also these threads, where others had a similar issue: |
Beta Was this translation helpful? Give feedback.
What you certainly can do, is add a
git pull
-step, before runninggit-auto-commit-action
.But I'm not this will work 100% of the time. By running jobs in parallel you're potentially creating a race-condition. Which commit should "win", if both commits are created in the same second?
See also these threads, where others had a similar issue: