Open rtsisyk opened 3 years ago
We ran into the same issue, except that instead of adding a submodule that references a non-existing commit we accidentally committed a submodule reference in a pull request without having the submodule mentioned in .gitmodules
.
The problem is that the actions/checkout
action stays on the broken commit forever because and gets stuck in the "setup auth" step which will fail for every subsequent job. I think this problem can be avoided by splitting the setup auth steps for the main repo from the setup auth steps of the submodules. Something like:
I think this way the action can switch away from the broken commit and recover.
I've been working around the issue by running this command before the checkout step:
git checkout -f $(git -c user.name=x -c user.email=x@x commit-tree $(git hash-object -t tree /dev/null) < /dev/null) || :
This sets HEAD to a dummy commit before checking out the tree. The checkout step will then do a git clean
which will wipe the tree before the auth step, preventing this issue from occurring again.
This appears to be a duplicate of #385
this should be resolved now... with some changes to the checkout code in #964..
To clarify - you need to run CI on this branch ONCE and all further runs on ALL branches will fail.