- Home /
Can't specify revision for git package dependency with SSH
I have created a package following the docs and published this in a Gitlab repository.
Now I'm trying to add this package as a dependency for my project like this:
"com.sample.package": "git@gitlab.com:myusername/packages/mypackage.git",
This works as expected and the package is added to the project. Now we want to specify a revision as described in the docs: https://docs.unity3d.com/Manual/upm-git.html#revision
So we tried:
"com.sample.package": "git@gitlab.com:myusername/packages/mypackage.git#v1.0.2",
"com.sample.package": "git+git@gitlab.com:myusername/packages/mypackage.git#v1.0.2",
"com.sample.package": "ssh://git@gitlab.com:myusername/packages/mypackage.git#v1.0.2",
"com.sample.package": "git+ssh://git@gitlab.com:myusername/packages/mypackage.git#v1.0.2",
where "v1.0.2" is a tag that exists in our repo.
This is the error we're getting in the inspector, for ANY of the tests I listed above:
An error occurred while resolving packages:
Project has invalid dependencies:
com.sample.package: Version 'git@gitlab.com:myusername/packages/mypackage.git#v1.0.2' is invalid. Expected one of: a 'SemVer' compatible value; a value starting with 'file:'; a Git URL starting with 'git:' or 'git+', or ending with '.git'.
In the docs there are no examples with SSH and specifying revisions, is this supported? We're not willing to change to HTTP because SSH is easier for us to make the Gitlab CI work.
been trying to fully migrate to packages for the last 3 years but always find some kind of blocker :(
@gnp89 Did you figure this out? I'm having the same issue on 2021 LTS.