Skip to content

Add a 'clean-exclude' option (to avoid cleaning node_modules) #862

Open
@dapirian

Description

@dapirian

Currently, the checkout action will delete node_modules with git clean -ffdx. Since I use (mostly) persistent self-hosted runners, it's extremely inefficient to constantly be deleting and recreating node_modules. It takes about a minute just to do the deletion in git clean and another 3 minutes to repopulate node_modules after that.

It would be much much faster to be able to pass the exclude flag to clean, for example:

git clean -ffdxe '/node_modules/'

# Or, more explicit...
git clean -ffdx --exclude='/node_modules/'

This could just be another argument to the action, so usage might be...

- name: Checkout
   uses: actions/checkout@v3
   with:
     clean-exclude: /node_modules/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions