game-ci / game-ci/unity-builder
Unable to import packages from private repo
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 313
- Avg merge
- 1h 39m
- Merged PRs (30d)
- 1
Description
**Bug description**
Have two packages hosted on github as private repos.
Getting this error:
```
An error occurred while resolving packages:
Project has invalid dependencies:
: Error when executing git command. Failed to add the ECDSA host key for IP address '140.82.114.4' to the list of known hosts (/root/.ssh/known_hosts).
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
```
(140.82.114.4 is a github.com ip)
**How to reproduce**
Yaml snippet:
```
# setup ssh agent to access private package repos in manifest
- uses: webfactory/ssh-agent@v0.5.4
with:
ssh-private-key: |
${{ secrets.SSH_PRIVATE_KEY }}
${{ secrets.SSH_PRIVATE_KEY_TWO }}
# test git clone (this successfully clones the repos, suggesting ssh-agent is setup properly)
# - name: Git Clone Test
# run: |
# git clone git@github.com:.git
# git clone git@github.com:.git
# cd
# ls
# Build
- name: Build project
uses: game-ci/unity-builder@v2
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
with:
targetPlatform: iOS
sshAgent: ${{ env.SSH_AUTH_SOCK }}
```
Format in manifest is: `ssh://git@github.com//.git`
**Expected behavior**
I expect it to successfully import these packages
**Additional details**
Followed these docs: https://game.ci/docs/github/builder#private-github-repositories
And ssh-agent docs: https://github.com/webfactory/ssh-agent
As per ssh-agent recommendations found, I also tried manually cloning the repos (see yaml) -- this worked fine, so I don't think there's an issue with my ssh-agent setup. Seems to break only when importing packages. If it matters, I did notice this log when I manually cloned: `Warning: Permanently added the ECDSA host key for IP address '140.82.114.3' to the list of known hosts.` (140.82.114.3 is another github ip). Maybe the problem has to do with it failing to do so in unity-builder container?
Also tried `webfactory/ssh-agent@v0.5.2` (what's currently in Game-CI docs).
Have tried other formats in the manifest (one above seems closest to what [Unity prescribes](https://docs.unity3d.com/Manual/upm-git.html)) with no luck. Tried the url format in terminal and it seems to work:
```
Hi /! You've successfully authenticated, but GitHub does not provide shell access.
```
So as far as I can tell, I have everything configured correctly on my end. Any ideas?
Contributor guide
Assessment
This issue has not been assessed yet.