Don't erase the repository directory when clean is false and the repo isn't cloned #561
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At present, if the repository directory doesn't contain a
.git
directory then the action always erases the entire repository directory, regardless of the "clean" setting. This PR amends the behaviour so that forclean: false
the directory is not erased if there's no.git
directory (if there is a.git
directory, then the checks proceed as before). It's obviously the user's responsibility (having setclean: false
) to ensure that the files left in the directory don't interface with ones which would be checked out.This was hit in ocaml/setup-ocaml@v2 (see ocaml/setup-ocaml#190). setup-ocaml v2 does some work in
_opam
which was then being unnecessarily erased if actions/checkout was used in a later step.