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

submodules: false not working - Checkout action still tries to checkout submodules that were removed. #988

Closed
rr-james-hickman opened this issue Oct 25, 2022 · 4 comments

Comments

@rr-james-hickman
Copy link

I have removed some old submodules from our project, but the checkout action fails due to an error when checking out submodules:

Setting up auth
[147](https://github.com/<ORGANIZATION>/<PROJECT>/actions/runs/3323339960/jobs/5493559562#step:3:152)
  /usr/bin/git config --local --name-only --get-regexp core\.sshCommand
[148](https://github.com/<ORGANIZATION>/<PROJECT>/actions/runs/3323339960/jobs/5493559562#step:3:153)
  /usr/bin/git submodule foreach --recursive git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :
[149](https://github.com/<ORGANIZATION>/<PROJECT>/actions/runs/3323339960/jobs/5493559562#step:3:154)
  Error: fatal: No url found for submodule path 'submodules/EBTExtractor' in .gitmodules
[150](https://github.com/<ORGANIZATION>/<PROJECT>/actions/runs/3323339960/jobs/5493559562#step:3:155)
  Error: The process '/usr/bin/git' failed with exit code 128

I have explicitly set submodules: false in the checkout action job, but it still appears to be trying to checkout submodules:

      - name: Checkout repository V3
        uses: actions/checkout@v3
        with:
          submodules: false

I have verified that all submodule references have been removed from the repository directory:

  • All submodules/xxx directories and files were deleted.
  • .gitmodules file was deleted.
  • All submodules entries in .git/config were deleted.

It seems like the only explanation is the checkout action is not properly respecting the submodules: false setting.

Can someone please take a look at this and see if it's an issue in the action?

@rr-james-hickman rr-james-hickman changed the title submodules: false not working. submodules: false not working - Checkout action still tries to checkout submodules that were removed. Oct 25, 2022
@gobetti
Copy link

gobetti commented Oct 26, 2022

I had the same issue. The key is here:

All submodules entries in .git/config were deleted.

The .git directory is local, you don't commit it, so in the runner machine that directory still exists. actions/checkout doesn't always fully delete the clone directory in the builder machine (see git-directory-helper.ts) so .git/config is still there with the old submodule references after changing submodules: true to false.

My workaround was to erase the clone directory in the runner machine.

@rr-james-hickman
Copy link
Author

@gobetti Thanks for the details information! This was super helpful and appears to be the root of our issue.
For us, we also have a daily cron job that runs and compares are previous release branches to the development branch to ensure development is always up-to-date with any patches made to release branches.
Some of the older release branches still had the submodules. So we deleted those branches and rebooted the runners to ensure a clean slate.

All seems well now :)

@joshgoebel
Copy link

I see this was closed, but is their as associated PR that resolved this issue such that submodules:false would prevent this behavior in the future - even if the start-up state was "inconsistent"? Thanks.

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

3 participants