Skip to content

Conversation

@elvinristi
Copy link
Member

@elvinristi elvinristi commented Oct 28, 2022

Background

Module https://github.com/webfactory/ssh-agent exports public keys from private keys under .ssh/ folder and depends only on ssh-agent behaviour on selecting correct cert.

When trying to pass to docker build with action which doesn't support forwarded ssh-agent then while trying to use generated key-* files then we get invalid format - with PEM or non-PEM / reason is that public key can not be used for ssh-git authentication.

Description

With this change we export all passed private keys and use new format for input - object key should be "[email protected]:owner/repo.git" and we will use that one instead of trying to extract comment from public key where it potentially could be missing.

Example usage

      - name: Register SSH keys
        uses: vaimo/webfactory-ssh-agent-github@feature/json-private-keys--v2
        with:
          ssh-private-keys: |
              {
                "[email protected]:vaimo/vsf2--test-package.git": "${{ secrets.VAIMO_PRIVATE_REPO_TEST }}",
                "[email protected]:vaimo/vsf2_ext-lru-cache-driver": "${{ secrets.VAIMO_PRIVATE_REPO_LRU_DRV }}"
              }

…t is json with array if {name, key} entries.
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