-
Notifications
You must be signed in to change notification settings - Fork 98
Add git insteadof
example
#273
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds documentation for configuring Git to use GitHub App tokens for authentication, addressing issue #270. The addition provides guidance for scenarios where tools use Git directly but cannot accept GitHub API tokens.
- Adds a new documentation section explaining Git's
insteadof
configuration option - Provides a complete workflow example for Python projects with private Git dependencies
- Includes additional configuration examples for repository and organization-specific authentication
# required | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.PRIVATE_KEY }} | ||
- name: Configure git to use the app token |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The placeholder 'USERNAME' in the Git URL is not explained. Consider clarifying what value should be used here or if it's a literal placeholder that Git ignores for token-based authentication.
- name: Configure git to use the app token | |
- name: Configure git to use the app token | |
# The USERNAME part of the URL can be any non-empty string (e.g., 'x-access-token'), as GitHub ignores it when a token is used. |
Copilot uses AI. Check for mistakes.
The above example will use the same token for all `git` operations on GitHub via `https`, but you can configure it on a per repository or per-organisation basis by changing the prefix: | ||
|
||
```bash | ||
git config --global url."https://USERNAME:${GITHUB_TOKEN}@github.com/MyOrg/MyRepo".insteadOf "https://github.com/MyOrg/MyRepo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example uses the same unexplained 'USERNAME' placeholder. For consistency and clarity, this should match the explanation provided for the main example above.
git config --global url."https://USERNAME:${GITHUB_TOKEN}@github.com/MyOrg/MyRepo".insteadOf "https://github.com/MyOrg/MyRepo" | |
git config --global url."https://x-access-token:${GITHUB_TOKEN}@github.com/MyOrg/MyRepo".insteadOf "https://github.com/MyOrg/MyRepo" |
Copilot uses AI. Check for mistakes.
Closes #270.