-
Notifications
You must be signed in to change notification settings - Fork 717
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provide info how to access private git dependencies via JWT access token (GitHub App) #6234
Comments
Can you explain what you are trying to do? I don't see the connection between You're right, you can't run |
The problem is NOT SSH. But the problem is accessing private repos via HTTPS e.g. via a So we should propose a way to how to access private repos via access tokens (https), instead of ssh. So my use case is to build an app which has private dependencies from my repo, such as: dependencies:
// ...
my_private_package
git:
url: "https://github.com/owner/my_private_package.git" But one cannot access it without credentials, like: Obiously, I cannot save the credentials inside the pubspec.yaml (they are also changing on every build, in contrast to a PAT). |
I was a bit lost, I found a more straight forward was to do it, as I think its already the case under the hood when requested for username and password locally. Anyways it should be stated as an alternative to SSH: git config --global credential.helper store
echo "https://x-access-token:${{ steps.app-token.outputs.token }}@github.com" > ~/.git-credentials
# Only needed if one wants to rewrite all ssh requests to GitHub to be used with http(s) credentials:
#git config --global url.https://github.com/.insteadOf ssh://git@github.com:
#git config --global url.https://github.com/.insteadOf git@github.com: |
This probably doesn't belong in the Dart documentation, since this is more related to Git and GitHub configuration. How about we add a note saying that in order to use HTTPS, you need to configure your git environment, and link out to the steps that you need to take for HTTPS for private repos from the GitHub documentation? |
Yes, a link would be nice. Just so that one knows that there's an alternative. |
Page URL
https://dart.dev/tools/pub/dependencies#git-packages
Page source
https://github.com/dart-lang/site-www/tree/main/src/content/tools/pub/dependencies.md
Describe the problem
For private git dependencies, it is recommended to use SSH. But GitHub themselves disengage SSH and also this is only feasable locally. On CIs for every private repo, a new SSH key has to be generated, which then can be entered in the repos as
Deployment Key
to allow fetching the dependency (one key CANNOT be used for multiple repos, unfortunately).So we should give the hint to authenticate via access tokens, e.g. one generated with "GitHub App"s.
Here a common workflow:
Would that be a valid approach to link in the docs?
Expected fix
Provide a link or add an example how to fetch private repository dependencies from git via access tokens.
Additional context
No response
I would like to fix this problem.
The text was updated successfully, but these errors were encountered: