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 multiple GitHub deploy key mappings with GitHub Actions #815

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

TrevorGibson-SR
Copy link

Proposed as a solution to #807

When cloning multiple private GitHub repositories with SSH, you can use the deploy key mapping feature of the webfactory/ssh-agent GitHub action to map specific SSH keys to their respective GitHub repositories. This works as intended when cloning in the main GitHub runner environment, but fails to translate over to the industrial_ci docker environment.

Webfactory/ssh-agent specifically calls this out and suggests to copy the ~/.ssh directory and ~/.gitconfig file into the docker container to ensure the mappings are carried over. This change simply adds two new docker mount arguments to import the SSH configuration into the Docker container's build environment.

Comment on lines +99 to +100
ici_forward_mount /home/runner/.gitconfig rw
ici_forward_mount /home/runner/.ssh rw
Copy link
Member

Choose a reason for hiding this comment

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

We cannot hardcode Gihub-specific paths.

@mathias-luedtke
Copy link
Member

Please try adding .gitconfig here:

export DOCKER_CREDENTIALS=${DOCKER_CREDENTIALS-.docker .ssh .subversion}

And why would we mount them rw?
This is not advisable for running CI locally.

@mathias-luedtke
Copy link
Member

I think we could just add .gitconfig to

export DOCKER_CREDENTIALS=${DOCKER_CREDENTIALS-.docker .ssh .subversion}

@mathias-luedtke
Copy link
Member

I think we could just add .gitconfig to

#844

@mathias-luedtke
Copy link
Member

@TrevorGibson-SR: The latest version should copy .gitconfig and .ssh. Is there anythings else needed for multiple SSH keys?

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

Successfully merging this pull request may close these issues.

2 participants