Search Unity

Can I use ssh public/private keys and #revision?

Discussion in 'Package Manager' started by samanabo, May 24, 2022.

  1. samanabo

    samanabo

    Joined:
    Mar 10, 2015
    Posts:
    51
    I'm attempting to create a custom package that is hosted on a private gitlab repository, using unity `2022.1.1f1`.
    Gitlab requires the use of public/private keys so I have to use ssh in order to add the package to a project.

    The issue I'm facing is that the package manager will only import the package (and use the correct keys) when I use the format:
    `"com.company.my-package": "git@gitlab.com:companyname/repository-name.git"`

    Any other format, such as including a revision or a protocol prefix in the url will result in an error (repo not found, expected SemVer compatible value, permission denied). It appears to be the same problem that this person reported here:
    https://answers.unity.com/questions/1893746/cant-specify-revision-for-git-package-dependency-w.html

    For reference, I am attempting to set this up so that the custom package repository contains a complete unity project that a person can download and contribute to the custom package, and at the same time, a revision can be committed that contains just the package contents so it can be pulled into another project.

    Is there a way to make this work so I can use a combination of ssh public/private keys and a revision hastag, especially when using gitlab?
    Thanks for the help!