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

Closed
DethRaid opened this issue Dec 3, 2019 · 19 comments · Fixed by #112
Closed

Checkout with submodules? #81

DethRaid opened this issue Dec 3, 2019 · 19 comments · Fixed by #112
Assignees
Labels
enhancement New feature or request

Comments

@DethRaid
Copy link

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
Copy link
Contributor

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

@DethRaid
Copy link
Author

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

@osyrisrblx
Copy link

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
Copy link

gunnsth commented Dec 5, 2019

Submodules with SSH checkout would be great

@ericsciple ericsciple added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 13, 2019
@ericsciple ericsciple self-assigned this Dec 13, 2019
@ChristophWurst
Copy link

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
Copy link
Contributor

good feedback @chrispat fyi

@eine
Copy link

eine commented Jan 3, 2020

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

@ericsciple
Copy link
Contributor

reopening and mark as enhancement for consideration

@ericsciple ericsciple reopened this Jan 4, 2020
@ericsciple ericsciple removed the documentation Improvements or additions to documentation label Jan 4, 2020
fogrew added a commit to fogrew/gurylev.com that referenced this issue Jan 5, 2020
@marcofranssen
Copy link

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
Copy link

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
Copy link

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
Copy link
Member

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
Copy link

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
Copy link
Member

chrispat commented Feb 13, 2020

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

@ericsciple
Copy link
Contributor

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
Copy link

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?

manimaul added a commit to manimaul/mxtide-android that referenced this issue Mar 3, 2020
revert due to need for submodules
actions/checkout#81
@ericsciple
Copy link
Contributor

ericsciple commented Mar 5, 2020

An input submodules has been added now. I merged to master, try it out and let me know. Collecting feedback and will update the v2 tag next week.

Also I'm hoping to merge support for SSH soon.

@ericsciple
Copy link
Contributor

I created a new issue to collect feedback on the submodules input - in master now, will update v2 tag next week.

@ericsciple
Copy link
Contributor

Thanks all for the feedback! I updated V2 to include the recent submodule/SSH changes from master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants