Skip to content
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

Open
1 task
Gustl22 opened this issue Nov 25, 2024 · 0 comments
Open
1 task
Labels
from.page-issue Reported in a reader-filed concern

Comments

@Gustl22
Copy link
Contributor

Gustl22 commented Nov 25, 2024

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:

    steps:
      - uses: actions/checkout@v4
      - uses: actions/create-github-app-token@v1
        id: app-token
        with:
          app-id: ${{ vars.APP_ID }}
          private-key: ${{ secrets.SSH_PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}
      - name: Set github url and credentials
        run: |
          git config --global --add url."https://x-access-token:${{ steps.app-token.outputs.token }}@github".insteadOf https://github
          git config --global --add url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf ssh://[email protected]:
          git config --global --add url."https://x-access-token:${{ steps.app-token.outputs.token }}@github.com/".insteadOf [email protected]:

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.

  • I will try and fix this problem on dart.dev.
@Gustl22 Gustl22 added the from.page-issue Reported in a reader-filed concern label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
from.page-issue Reported in a reader-filed concern
Projects
None yet
Development

No branches or pull requests

1 participant