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

Checkout with submodules? #81

Open
DethRaid opened this issue Dec 3, 2019 · 16 comments · Fixed by #112
Open

Checkout with submodules? #81

DethRaid opened this issue Dec 3, 2019 · 16 comments · Fixed by #112
Assignees
Labels

Comments

@DethRaid
Copy link

@DethRaid DethRaid commented Dec 3, 2019

How do I checkout with submodules?

Before the most recent commit to master (e347bba) I could use submodules:true to checkout with submodules.. but it looks like yalls just removed that?

This change caused my most recent Actions checks (https://github.com/NovaMods/nova-renderer/runs/331364250) to fail to checkout

Unless I'm missing something, it seems that yalls updated the checkout action to not support submodules and that broke my Actions check

@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Dec 3, 2019

@DethRaid make sure to pin to checkout/actions@v1 which will restore the functionality. Currently it's not supported in v2

@DethRaid

This comment has been minimized.

Copy link
Author

@DethRaid DethRaid commented Dec 3, 2019

I actually made a PR to do just that: NovaMods/nova-renderer#225

It's really great when I merge a PR that had no CI failures, only for master to have CI failures because GitHub removed a feature I was using

I guess it's my own fault for not using a specific version of this Action but it still sucks

AddressXception added a commit to microsoft/electionguard-c that referenced this issue Dec 3, 2019
@AddressXception AddressXception mentioned this issue Dec 3, 2019
9 of 9 tasks complete
echumley-msft added a commit to microsoft/electionguard-c that referenced this issue Dec 3, 2019
skibitsky added a commit to skibitsky/skibitsky.github.io that referenced this issue Dec 4, 2019
@osyrisrblx

This comment has been minimized.

Copy link

@osyrisrblx osyrisrblx commented Dec 4, 2019

Are there plans to support submodules in v2?
I'd appreciate the perf improvements, but I do need submodules. 😄

Of course, for now I'll stick with v1.

@gunnsth

This comment has been minimized.

Copy link

@gunnsth gunnsth commented Dec 5, 2019

Submodules with SSH checkout would be great

@ChristophWurst

This comment has been minimized.

Copy link

@ChristophWurst ChristophWurst commented Dec 16, 2019

Hey @ericsciple!

Thanks for your fixes in #112. In our organization we have to deal with submodules a lot and thus I would like to kindly ask why the shortcut of with.submodules was removed from v2? I don't find the

run: |
    auth_header="$(git config --local --get http.https://github.com/.extraheader)"
    git submodule sync --recursive
    git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1

easy to use considering that I maintain many repositories. Would it be possible to revive the with.submodules shortcut?

@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Dec 16, 2019

good feedback @chrispat fyi

@eine

This comment has been minimized.

Copy link

@eine eine commented Jan 3, 2020

@ericsciple, @chrispat, any updates about this issue? Did you consider to reopen it?

@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Jan 4, 2020

reopening and mark as enhancement for consideration

@ericsciple ericsciple reopened this Jan 4, 2020
fogrew added a commit to fogrew/gurylev.com that referenced this issue Jan 5, 2020
whaaat, v2 not supported submodules! actions/checkout#81
@marcofranssen

This comment has been minimized.

Copy link

@marcofranssen marcofranssen commented Jan 27, 2020

This only seems to work for submodules using https.

run: |
    auth_header="$(git config --local --get http.https://github.com/.extraheader)"
    git submodule sync --recursive
    git -c "http.extraheader=$auth_header" -c protocol.version=2 submodule update --init --force --recursive --depth=1

I need it to work via SSH. Anyone knows how to make this work with SSH?

@webknjaz

This comment has been minimized.

Copy link

@webknjaz webknjaz commented Feb 5, 2020

@marcofranssen you can use https://github.com/marketplace/actions/webfactory-ssh-agent to spawn an ssh-agent and add appropriate SSH private keys there. After that, your tools that use SSH should pick them up.

@marcofranssen

This comment has been minimized.

Copy link

@marcofranssen marcofranssen commented Feb 6, 2020

@webknjaz thanks, will give that a try as well. I finally managed to fix it by replacing the ssh with https address as explained in https://github.com/actions/checkout/pull/140/files

@chrispat

This comment has been minimized.

Copy link
Member

@chrispat chrispat commented Feb 13, 2020

Just to provide some background context.

We chose to leave submodules out of the v2 rewrite for two main reasons. First because Actions is a per repository app installation the default token does not provide access to other private repositories even in the the same org or account. Second many developers configured their submodules to use SSH instead of HTTPS and in that case even public submodules would fail.

As such we decided to take a step back and see what options we had to provide a better support for public and private submodules using HTTPS or SSH. Unfortunately the developer who had been working on this issue had to take some unexpected time off to attend to a family matter.

He is back now and you should expect to see an update coming to the repo with our proposal for how we would like to add this functionality back. We look forward to the communities comments on the pull request.

@eine

This comment has been minimized.

Copy link

@eine eine commented Feb 13, 2020

He is back now and you should expect to see an update coming to the repo with our proposal for how we would like to add this functionality back.

Is it expected to be a fix to v2 or a new v3?

@chrispat

This comment has been minimized.

Copy link
Member

@chrispat chrispat commented Feb 13, 2020

Since it should just be additive it will be an update to v2.

@ericsciple

This comment has been minimized.

Copy link
Member

@ericsciple ericsciple commented Feb 13, 2020

Opened a PR to propose SSH support here which will help for users scripting submodule checkout.

Will open a separate proposal shortly for a first-class submodules input.

@sjackman

This comment has been minimized.

Copy link

@sjackman sjackman commented Feb 14, 2020

A related problem with Rust is cargo downloading crates from private repos. I solved this problem by creating a PAT and adding it to the repo's secrets named GITHUB_PAT:

echo 'https://USERNAME_OF_PAT:${{secrets.GITHUB_PAT}}@github.com' >~/.git-credentials
git config --global credential.helper store
cargo test

Worked like a charm!

Can USERNAME_OF_PAT be omitted? Can you use either https://x-auth-token:${{secrets.GITHUB_PAT}}@github.com or https://${{secrets.GITHUB_PAT}}@github.com?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

10 participants
You can’t perform that action at this time.