Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install package from github private repo without personal access token

I am trying to install an R package from a GitHub account I currently own and operate. I want to be able to share this R package with other users (i.e. allow them to download) but I want to constrain it to people I approve of.

I could do this by creating a Personal Access Token (PAT) and sharing (remotes::install_github(..., auth_token = "PAT")), but then they would get access to all of my repos on my account which is not an option.

Other options I have seen suggested include;

  • Creating a new GitHub account just for this R package and creating the PAT on this account to enable sharing of just the one repo
  • Making public instead of private

Neither of these feels optimal, is there another way?

like image 738
JFG123 Avatar asked Feb 10 '26 17:02

JFG123


2 Answers

You could add others as collaborators on your private repo, then they could use their own PAT to access the repo. It's not great idea to share PAT so this way each party is responsible for their own. That will also allow you to easily remove individuals without affecting access for everyone.

like image 180
MrFlick Avatar answered Feb 12 '26 14:02

MrFlick


I know this is an old question, but I wanted to answer for anyone that finds this thread like I did. The other alternative is to set up a private SSH key (like you would use for git push) and then use remotes::install_git("[email protected]:Organiztation/repository.git",branch = ...). install_git uses the git credentials and supports SSH. install_github uses the GitHub API and does not support SSH.

like image 33
Adam Sampson Avatar answered Feb 12 '26 16:02

Adam Sampson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!