You might try and include in your GitHub Action workflow the webfactory/ssh-agent
action:
When running a GitHub Action workflow to stage your project, run tests or build images, you might need to fetch additional libraries or vendors from private repositories.
GitHub Actions only have access to the repository they run for.
So, in order to access additional private repositories:
- create an SSH key with sufficient access privileges.
- Then, use this action to make the key available with ssh-agent on the Action worker node.
- Once this has been set up, git clone commands using ssh URLs will just work. Also, running ssh commands to connect to other servers will be able to use the key.
That would give a workflow like:
# .github/workflows/my-workflow.yml
jobs:
my_job:
...
steps:
- actions/[email protected]
# Make sure the @v0.4.1 matches the current version of the
# action
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- ... other steps
CLICK HERE to find out more related problems solutions.