Skip to content

Commit b49707e

Browse files
committed
README: document OIDC publishing
Signed-off-by: William Woodruff <[email protected]>
1 parent 2e8427e commit b49707e

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,46 @@ PyPI, which is recommended to restrict the access the action has.
6161
The secret used in `${{ secrets.PYPI_API_TOKEN }}` needs to be created on the
6262
settings page of your project on GitHub. See [Creating & using secrets].
6363

64+
### Publishing with OpenID Connect
65+
66+
**IMPORTANT**: This functionality is in beta, and will not work for you
67+
unless you're a member of the PyPI OIDC beta testers' group. For more
68+
information, see
69+
[warehouse#12965](https://github.com/pypi/warehouse/issues/12965).
70+
71+
This action supports PyPI's
72+
[OpenID Connect publishing](https://pypi.org/help/#openid-connect)
73+
implementation, which allows authentication to PyPI without a manually
74+
configured API token or username/password combination. To perform
75+
OIDC publishing with this action, your project's OIDC publisher must
76+
already be configured on PyPI.
77+
78+
To enter the OIDC flow, configure this action's job with the `id-token: write`
79+
permission and **without** an explicit username or password:
80+
81+
```yaml
82+
jobs:
83+
pypi-publish:
84+
name: upload release to PyPI
85+
runs-on: ubuntu-latest
86+
permissions:
87+
# IMPORTANT: this permission is mandatory for OIDC publishing
88+
id-token: write
89+
steps:
90+
# retrieve your distributions here
91+
92+
- name: Publish package distributions to PyPI
93+
uses: pypa/gh-action-pypi-publish@release/v1
94+
```
95+
96+
Other indices that support OIDC publishing can also be used, like TestPyPI:
97+
98+
```yaml
99+
- name: Publish package distributions to TestPyPI
100+
uses: pypa/gh-action-pypi-publish@release/v1
101+
with:
102+
repository-url: https://test.pypi.org/legacy/
103+
```
64104

65105
## Non-goals
66106

0 commit comments

Comments
 (0)