A Github Action to add a deploy key to a repository
Currently action/checkout
does not natively support checking out submodules with deploy keys (issue).
This action pairs specified repository and ssh key. No extra configuration is needed for subqequent actions/checkout
to checkout submodules.
For example if you want to clone oursky/private-repo-child
inside oursky/private-repo-parent
:
- Generate a deploy key for
oursky/private-repo-child
with read access. - Add the deploy key to
oursky/private-repo-parent
's secrets.
- uses: oursky/action-deploy-key@v0
with:
repo: oursky/private-repo-child
ssh-private-key: ${{ secrets.DEPLOY_KEY_FOR_PRIVATE_REPO_CHILD }}
- uses: actions/checkout@v3
with:
submodules: true
repo
(required): The repository to add the deploy key to.ssh-private-key
(required): The deploy key.