I have a project with a Node dependency on a private Git repository. I need to be able to run npm install
without being prompted to enter a password or allow an SSH connection, so I'm using an access token that I created on GitHub in my package.json:
"dependencies": { "sass-theme": "git+https://[token]:[email protected]/MyOrg/sass-theme.git#v1.0.2", "node-sass": "^4.5.0" }
This project is shared with dozens of other people, so obviously I don't want to keep my token in source control. I know I can create a read-only deployment key on GitHub, but I believe that would require other developers to import the SSH key to build the project locally.
Is it possible to create an access token that can be shared but that has read-only access to clone the repository?
You can 'clone' the Repository with either Read+Write or Read-Only access: To look at the code and build individual branches, but if you don't need to upload to the repository, choose Read-Only access.
the most straightforward way I can think of to create a token that provides read only access to a private repo is to
It would be best if they didnt have other repo accesses for other orgs/repos , since that scope essentially gives that total control over any repos that user controls.
I know in an Enterprise solution we would do that maybe with a system ID, I am not sure exactly what type of user account might be available in github.com actual but I would check the Terms of service first.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With