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

Add suport for checking out with SSH key #72

Closed
danechitoaie opened this issue Nov 23, 2019 · 9 comments
Closed

Add suport for checking out with SSH key #72

danechitoaie opened this issue Nov 23, 2019 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@danechitoaie
Copy link

Hi,

Opening a separate issue based on discussion from #63
It would be really nice if checking out with a SSH key would also be supported.
It would make things a bit more secure. With a PAT you basically give access to all the repos that user has access. With a SSH key you could give access only to the specific repo the SSH key is setup for.
It can be a new input option to the checkout action that would temporarily (for the duration of the checkout action) create the ~/.ssh/id_rsa file with what was provided as input, use that for git clone and then restore the previous ~/.ssh/id_rsa (if any) after current checkout task is done.
Or maybe there's a better option.

@chrispat
Copy link
Member

chrispat commented Dec 5, 2019

I think this could be very useful to have.

@gunnsth
Copy link

gunnsth commented Dec 5, 2019

This would be great for working with submodules too, currently when updating the submodules pulls up the http GitHub user credentials rather than using the SSH key. When working with the repository locally.

@ericsciple ericsciple added the enhancement New feature or request label Dec 13, 2019
@ericsciple
Copy link
Contributor

proposed here: #156

@ericsciple
Copy link
Contributor

ericsciple commented Mar 6, 2020

related to #178 too

@ericsciple
Copy link
Contributor

A new input ssh-key is in master now. Gathering feedback on this issue before moving v2 tag forward.

@neyb
Copy link

neyb commented Mar 15, 2020

this is issue is not dedicated to submodules, while #176 is. So I decide to give a feedback here :

edit: my bad : i was using @v2, and its only on @master

@neyb
Copy link

neyb commented Mar 15, 2020

still got a problem :

https:/neyb/armor-hunter/runs/508953664#step:7:28

the ssk key seems not to accessible for other repositories.
this should cause submodules to fail I think

@ericsciple
Copy link
Contributor

ericsciple commented Mar 19, 2020

@neyb the SSH key isnt configured globally for the user. The SSH command is overwritten in the local git config. You could get it from the config and export to an env var if needed.

export GIT_SSH_COMMAND=$(git config --local --get core.sshCommand)

@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

No branches or pull requests

5 participants