Sugestion: add private repositories support in recipe engine
See original GitHub issueThe following use case: As a server developer, I would like to supply the Github OAuth token to allow for private GitHub repos to be downloaded as part of the recipe.
There is a way to do it today directly via the command line. To also have it be exposed in a recipe.
git pull https://$OAUTH_TOKEN:x-oauth-basic@github.com/name/repo.git master
It could be entered in the UI and stored as a tmp variable that then can be defined in the yaml?
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Is it possible to use pip to install a package from a private ...
I figured out a way to automagically 'pip install' a GitLab private repository that requires no password prompt. This approach uses GitLab "Deploy...
Read more >Inviting collaborators to a personal repository - GitHub Docs
In the search field, start typing the name of person you want to invite, then click a name in the list of matches....
Read more >Repository mirroring - GitLab Documentation
Changes you make to your GitLab repository are copied to the old location. Your GitLab instance is private, but you want to open-source...
Read more >Repo documentation for recipe_engine - Google Git
Repo documentation for recipe_engine. Table of Contents. Recipe Modules. archive; assertions; buildbucket — API for interacting with the buildbucket service ...
Read more >GitPi: a Private Git Server on Raspberry Pi - Instructables
1. First, setup a Raspberry Pi for ssh access and that it's on your home wifi network, which means that you can log...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
for it to show on the UI, you have to create a var for it, so the var could have the token, or the var could be empty and the user fills it manually
Digging up this issue, I’m going to share some thoughts here.
Background
As a review for the download_github task in the recipeEngine.js it seems as though it’s making 2 calls to github.com. (It seems this was refreshed from https://github.com/axios/axios over to https://github.com/sindresorhus/got between the time I’ve looked at this las.)
The first call occurs at https://github.com/tabarra/txAdmin/blob/63afc1048806d251669419fb6311ef506dbf672a/src/extras/recipeEngine.js#L113 where we get the default branch name for the repo to later use here https://github.com/tabarra/txAdmin/blob/63afc1048806d251669419fb6311ef506dbf672a/src/extras/recipeEngine.js#L122 .
Both of these calls would need authenticated through Github for the code to continue to work as it does today and expand it to a private repo.
Creating a personal access token in github as the instructions indicated here (We’ll define this token as GITHUB_PAT going forward.) allows a user to make both of these calls against an “internal” repo or a “private” repo. Upon further experimentation you’ll need to add a header to both of the indicated calls above following this object. { “key”: “Authorization”, “value”:
Bearer ${GITHUB_PAT}
}.Passing in the header into the call where GITHUB_PAT equals an empty or a null value causes 401s to be returned from github.com regardless of the permission/visibility settings of the repo. The existence of the header does not limit the ability to download ‘public’ repos. The addition of this GITHUB_PAT token may cause tighter rate limiting than without any token at all, however that does still need to be experimented.
What I need help with is design and a few questions.
Recipe 1
Recipe 2
Would we want to check the visibility of the repo to decide if we add the GITHUB_PAT token to the call? That would add a 3rd additional call to github.com for each github_download task.
Would you want to do an implicit Auth where txAdmin would create a GITHUB_PAT for the user as the user uses the UI?
Would you prefer a dark launch of the GITHUB_PAT in multiple PRs or just build out the whole thing?