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

Don't erase the repository directory when clean is false and the repo isn't cloned #561

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dra27
Copy link

@dra27 dra27 commented Aug 3, 2021

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 for clean: 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 set clean: 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.

If the checkout directory doesn't contain .git, previously the action
always erased the entire directory: now, it only does it if the clean
input is true (which is the default).

This means that files set-up _before_ actions/checkout is used do not
get erased before cloning and checkout the repository.
@smorimoto
Copy link

@thboop @ericsciple Could you check this?

@smorimoto
Copy link

CC: @dhadka

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

Successfully merging this pull request may close these issues.

2 participants