Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working directory may be corrupted when process dies while .git/config.lock exists and checkout will always fail #2117

Open
thomasjahoda opened this issue Mar 25, 2025 · 0 comments

Comments

@thomasjahoda
Copy link

If the process dies while updating the local Git config file, the working directory for the current runner may be corrupted (.git/config.lock keeps existing) and actions/checkout@v4 will always fail.

We had the following error while running a GitHub action in a Docker container:

Run actions/checkout@v4
[...]
Setting up auth
  [...]
  Error: error: could not lock config file .git/config: File exists

How to reproduce

Create the lockfile in the action-runner working directory: touch .git/config.lock to simulate the corrupted state when the process dies during checkout.
Start some workflow running "actions/checkout@v4".

Expected behavior

actions/checkout@v4 detects the corrupted state and removes the whole repository.

Actual behavior

Error.

Workaround

Manually clean the working directory of the action-runner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant