Skip to content

Git SSH Key via environment variable #47

@leo-schick

Description

@leo-schick

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions