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

bug: checkout will leak submodules from the previous branch on self-hosted runners #1855

Open
milesvant opened this issue Aug 16, 2024 · 1 comment

Comments

@milesvant
Copy link

milesvant commented Aug 16, 2024

The clean argument (which executes git clean -ffdx && git reset --hard HEAD) is insufficient for cleaning up a previous branch's submodule state. git clean will not remove the submodule's folder since it is checked in, meaning that it remains in the repo as untracked state when you checkout a different branch which does not contain the submodule. I resolved this by cleaning after checkout as well:

      - uses: actions/checkout@v4

      # Because each invocation is not in an isolated environment, we need to force clean
      # AFTER checkout to remove any stale submodule state from a previous branch's run.
      - name: Clean git state
        run: git clean -ffdx
@AceCoderLaura
Copy link

There's an outdated branch you can use to fix this (#628) but would be nice to get this fixed in main.

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

2 participants