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

Git SSH Key via environment variable #47

Open
leo-schick opened this issue Jan 30, 2023 · 1 comment
Open

Git SSH Key via environment variable #47

leo-schick opened this issue Jan 30, 2023 · 1 comment

Comments

@leo-schick
Copy link
Contributor

I have some private repositories as dependend packages for my dbt project as described in the dbt documentation here.

I need a way to add a private SSH key for private repositories via an environment variable.

Sample solution:

Add a default ~/.ssh/config:

Host github.com
    HostName github.com
    User git
    IdentityFile ~/.ssh/id

Add the following commands to the dockerfile:

RUN echo "$DBT_ACTION_GIT_SSH_KEY" > ~/.ssh/id
RUN chmod 0600 ~/.ssh/id
RUN ssh-keyscan -H github.com >> ~/.ssh/known_hosts

*not tested

@leo-schick leo-schick changed the title SSH Key Git SSH Key via environment variable Jan 30, 2023
@leo-schick
Copy link
Contributor Author

leo-schick commented Apr 25, 2023

I tried myself to make this work, but was not able to do so.

I switched now from git ssh packages over to use HTTPS with Git Token Method for authentication as workaround. It works quite well.

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

No branches or pull requests

1 participant