-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
When depending on a private repository with poetry
, it is not straightforward how to include this in CI:
In the pyproject.toml
, the dependency is specified as
package_name = { git = "https://github.com/organization/repository", branch = "branch_name" }
This works for local installs where the user is authenticated to GitHub, but on CI poetry
doesn't recognize / use the token. As a workaround, we can use
git config --global url."https://${{ secrets.TOKEN_NAME }}@github.com/organization/repository".insteadOf "https://github.com/organization/repository"
to let git prepend the token whenever the given URL is encountered. In this way, token authentication can be used without having to hard-code (and, depending on current or future repo visibility, leak the token) in pyproject.tml
.
This workaround should be documented, but it's not obvious where to do so; it's a bit too niche to belong in the general packaging guide IMO.
mskoenz and jacobevansgit
Metadata
Metadata
Assignees
Labels
No labels