Skip to content

Commit

Permalink
fix: error occurs when publishing using trusted publisher.
Browse files Browse the repository at this point in the history
Related #1868

Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed May 9, 2023
1 parent 23ae2b7 commit c294b62
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions news/1868.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix the error when publishing using trusted publisher.
1 change: 1 addition & 0 deletions news/1904.bugfix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix a bug that `PATH` env var isn't set correctly when running under non-isolation mode.
2 changes: 1 addition & 1 deletion src/pdm/cli/commands/publish/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ def __init__(
if ca_certs is not None:
self.session.set_ca_certificates(pathlib.Path(ca_certs))
self._credentials_to_save: tuple[str, str, str] | None = None
self.ui = project.core.ui
username, password = self._ensure_credentials(username, password)
self.session.auth = (username, password)
weakref.finalize(self, self.session.close)
self.ui = project.core.ui

def _ensure_credentials(self, username: str | None, password: str | None) -> tuple[str, str]:
netloc = urlparse(self.url).netloc
Expand Down

0 comments on commit c294b62

Please sign in to comment.