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 support for source/destination ssh keys #22

Merged
merged 4 commits into from
Jan 18, 2021
Merged

Conversation

homerjam
Copy link
Contributor

@homerjam homerjam commented Dec 2, 2020

No description provided.

@wei
Copy link
Owner

wei commented Dec 2, 2020

Thanks for contributing, I definitely have encountered the same problem trying to set up ssh deploy keys on multiple repos as GitHub does not allow a key to be reused.

However, this is a major breaking change and will need to be test thoroughly with a major version bump, unless you are able to support the existing ssh_private_key usage?

Btw what are you using for linting README? Prettier? Thanks!!

@wei wei self-requested a review December 2, 2020 22:19
@wei wei added the enhancement New feature or request label Dec 2, 2020
@homerjam
Copy link
Contributor Author

homerjam commented Dec 2, 2020

Yes Prettier! (I think)

Ok I will try to incorporate the ssh_private_key back in, maybe we can allow for the ssh keys to be optionally overridden by the new source and destination keys. Any thoughts? 🤔

@wei
Copy link
Owner

wei commented Dec 2, 2020

Yeah. You can probably just add the variable back in, and do

if [[ -n "$SSH_PRIVATE_KEY" ]]
then
  mkdir -p /root/.ssh
  echo "$SSH_PRIVATE_KEY" | sed 's/\\n/\n/g' > /root/.ssh/src_id_rsa
  chmod 600 /root/.ssh/src_id_rsa
  echo "$SSH_PRIVATE_KEY" | sed 's/\\n/\n/g' > /root/.ssh/dst_id_rsa
  chmod 600 /root/.ssh/dst_id_rsa
fi

before the src/dest ssh private keys to achieve that.

action.yml Outdated
ssh_private_key:
description: SSH key used to authenticate with git clone urls provided (optional if public or https clone url with authentication)
source_ssh_private_key:
description: SSH key used to authenticate with source ssh clone url provided (optional if public or https clone url with authentication)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing to look into: since the default id_rsa is no longer used, we need to make sure public ssh clone urls still work without a id_rsa.

@wei
Copy link
Owner

wei commented Dec 7, 2020

Thanks for putting it together and making the updates. I'll need to find some time to test it and will merge once everything is tested. Thank you!

In the meantime anyone interested in this feature should be able to use wei/git-sync@d4bce1c and subscribe to this issue for the release #.

@wei wei mentioned this pull request Dec 7, 2020
@wei wei merged commit 55c6b63 into wei:master Jan 18, 2021
@wei
Copy link
Owner

wei commented Jan 18, 2021

Thanks for your contribution. This feature is now available with wei/git-sync@v3 or wei/git-sync@v3.0.0 🎉

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 this pull request may close these issues.

2 participants