Closed jojo2357 closed 3 years ago
Re-running a workflow will use the exact same commit SHA and ref values (Docs).
So when a workflow is re-run, it won't checkout the latest commit of your project, but rather the exact same commit for which the run was originally created.
git-auto-commit won't/can't solve this problem for you. As the name suggest, it's about committing and pushing. If you regularly encounter this problem I would suggest two options:
git pull
step to your workflow to ensure, that the git repo is always up to date and on the latest commit. (You are then also in control, on how the remote commits should be merged into the repo during the workflow run)push_options: '--force'
to your workflow, to overwrite any changes that are present on remote. (You will loose data here)(I won't add a git pull
call to the Action, as I think the consumers of this Action should be in control of this step. A git pull
could also lead to merge conflicts which can be solved in different ways. It's easier for us if consumers of the Action are in control of this step)
Ah yes that makes sense. In my particular case, adding force should do the trick since the data overwrites anyway. I just didn't know if it was a me problem or an action problem or the fix so thanks for that.
Version of the Action
v4.10.0
v4.9.2
The bug When using this action in a workflow, it fails when the workflow makes changes to the repo during a re-run of the job.
To Reproduce
Expected behavior The action will complete without error and create a new commit
Used Workflow
Additional context A log of a failed run can be found here