question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't fetch private UPM Packages from github because can't add my github credentials to Unity

See original GitHub issue

Bug description We’re using private packages from github in the Unity Package Manager. Building does not work with this because Unity asks for my github credentials. On my local Windows machine, Github Crendetial Manager pops up and I can insert them. What do I have to do in an github action to add them?

- stderr: fatal: could not read Username for 'https://github.com': terminal prompts disabled
Project has invalid dependencies:
de.lefx.stepmanager: Error when executing git command. fatal: could not read Username for 'https://github.com': terminal prompts disabled

I’ve tried to add my github credentials with fusion-engineering/setup-git-credentials@v2.0.1 but does not work either.

How to reproduce

Try building a project with UPM dependency from a private github URL.

Expected behavior

Project builds 😃

Additional details

I’ve added my script and the logfiles

build.zip logs_51.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:19 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
webbertakkencommented, Jan 6, 2021

That’s a fair point and thank you for elaborating on your use case, this is very helpful.

I suppose we could add gitUser and gitPassword as parameters and pass them into the image.

I believe unity has specific ENV variables it wants to use for UPM.

Open for contributions.

1reaction
webbertakkencommented, Sep 22, 2021

Since MYPACKAGE is a different repo i’m not sure this is going to work. In te last section of the page linked above https://docs.github.com/en/actions/security-guides/automatic-token-authentication#granting-additional-permissions it suggests that if you need more permissions that are given to the githubToken you would need to create a PAT (which would need to belong to a user).

I see. If that is GitHub official answer (for now) then so is ours. I stand corrected. Conceptually though not everyone has their own tokens for CI, just the person setting it up configures a token. Not sure if this is obvious for everyone or not.

As for the cases let’s also consider:

  1. Packages from public repositories
  2. A mixture, where some might be private or even vendor owned and others public or in the same repository.

That is to say that I think we’d like to support a similar solution as the one you proposed, as long as it works for everyone or is forward compatible with all cases in some way.

Finally, let’s see how much of the problem would get solved by https://github.com/game-ci/unity-builder/pull/278/files or how much of that PR can be reused.

Thank you for your extended explanation and consideration. 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Github private repositories - Entering username and ...
I'm trying to load a private Github repository of mine. I'm getting the following error: Cannot perform upm operation: Unable to add package...
Read more >
Installing from a Git URL
Open the add menu in the Package Manager's toolbar. · The options for adding packages appear.
Read more >
Unity cant add git packages on external SSD. FATAL: not in ...
I've been having the same issue drive me crazy for weeks now. On my end, the issue was a combination of. the external...
Read more >
How to setup GitHub packages and Unity - Enigma 23
Installing npm · GitHub Personal Access Token (PAT) · Setting up GitHub npm authentication · Create a GitHub repository · Creating a package.json...
Read more >
Package Registry - GitLab Docs
If you have not activated the “Packages” feature for your project at Settings > General > Project features, you will receive a 403...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found