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

feat: replace ssh-private-key with ssh-private-keys and expected input is json with {name: key} entries. #2

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

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
1 participant