checkout icon indicating copy to clipboard operation
checkout copied to clipboard

clean submodule

Open GongT opened this issue 5 years ago • 4 comments

current

When clean: true, during Cleaning the repository, it will do:

git clean -ffdx
git reset --hard HEAD

want

When submodules: true or submodules: recursive, I want it also do:

git submodule foreach [--recursive] git clean -ffdx
git submodule foreach [--recursive] git reset --hard

why

I have a submodule in C++, I want to recompile it without cache everytime.

I was manually run git reset before make. But after I set submodule.xxx.update = rebase, it may (or may not) fail during Fetching submodules step.

The clean step must happend before submodule update in my case.

GongT avatar Sep 28 '20 07:09 GongT

Hello,

Why is this still open? This is a big deal! It's not possible to have a reliable CI without the mean to clean the submodules when checking-out.

Hish15 avatar Apr 18 '23 12:04 Hish15

I ran into this issue recently. For me, a file in a submodule got modified by a previous run and then was present in the next run, causing issues.

It would be nice if this got merged so I can have reliable CI without adding hacks.

This was my workaround by the way:

      - uses: actions/checkout@v3
        with:
          submodules: true
      - name: Submodule cleanup fix  # Bodge for https://github.com/actions/checkout/issues/358
        run: |
          git submodule foreach --recursive git clean -ffdx
          git submodule foreach --recursive git reset --hard

OscarVanL avatar Aug 10 '23 13:08 OscarVanL

I've also encountered this issue

daniel-carr-3000 avatar Mar 13 '24 15:03 daniel-carr-3000

@joshmgross @cory-miller you guys seem to be the only ones maintaining this repository even though it is an official Github action. Would you mind looking into this? There is even a PR ready.

lehmanju avatar Aug 05 '24 11:08 lehmanju

I encountered this issue too

Aleqsd avatar Jan 07 '25 11:01 Aleqsd

We have this issue as well, it affects people running self-hosted runners the most because i.e. a simple rename action to add -SNAPSHOT-1 to the build artifact outputs results in hundreds of files with increasingly long names, -SNAPSHOT-1-SNAPSHOT-2-SNAPSHOT-3 etc accumulating on the build server inside the submodule.

Thanks @OscarVanL for the quick and easy workaround to copy+paste.

kvanbere avatar Jan 21 '25 03:01 kvanbere

Bump, this is really important.

kvanbere avatar Apr 01 '25 00:04 kvanbere

The fact that GitHub, a git hosting service doesn't give a darn about their git checkout action working properly never stops being painfully ironic. It's been half a decade since this issue was opened, guess small indie company Microsoft can't spare anyone to look at it.

AceCoderLaura avatar Apr 02 '25 00:04 AceCoderLaura

Bump

NorseGaud avatar Aug 05 '25 02:08 NorseGaud