Closed
Description
Filing this as a proposal, since it'll probably need a bit of discussion/deprecation planning.
Rationale:
- For the vast majority of users publishing to PyPI via GitHub Actions, trusted publishing is the appropriate authentication mechanism
- For users who can't use trusted publishing for whatever reason, manually configured API tokens are a suitable (and encouraged) alternative
Proposal: when the target is PyPI or TestPyPI, fail (with an explanatory error message) any run of the workflow that:
- Isn't using trusted publishing, and
- Is using a manually-configured credential that doesn't look like an API token (i.e. is not a username of
__token__
and a password ofpypi-...
).
Other considerations:
- This may be slightly more involved than just checking the inputs, since some users may choose to use
TWINE_USERNAME
etc. directly (if the action exposes these?) - There should probably be a lengthy deprecation period for this change: while there's a functional migration path that's immediately available, there are undoubtedly a large number of workflows currently using user/pass combinations
- We should take care to only perform these checks if the index target is PyPI or TestPyPI (since other indices may not support API tokens or trusted publishing)
CC @di @sethmlarson for thoughts as well (this came up during discussion between the three of us)
Metadata
Metadata
Assignees
Labels
No labels