Skip to content

Commit 5fb2f04

Browse files
committed
Drop __token__ from README code usage snippets
This patch reduces the emphasis on the `__token__` value of the `user` input since it's default anyway. It also adds a separate paragraph showing how to specify a custom username if the need be. Ref: pypa/packaging.python.org#1108
1 parent 7bbdccd commit 5fb2f04

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

README.md

+12-4
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ To use the action add the following step to your workflow file (e.g.
2525
- name: Publish a Python distribution to PyPI
2626
uses: pypa/gh-action-pypi-publish@release/v1
2727
with:
28-
user: __token__
2928
password: ${{ secrets.PYPI_API_TOKEN }}
3029
```
3130
@@ -50,7 +49,6 @@ So the full step would look like:
5049
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
5150
uses: pypa/gh-action-pypi-publish@release/v1
5251
with:
53-
user: __token__
5452
password: ${{ secrets.PYPI_API_TOKEN }}
5553
```
5654

@@ -112,7 +110,6 @@ The action invocation in this case would look like:
112110
- name: Publish package to TestPyPI
113111
uses: pypa/gh-action-pypi-publish@release/v1
114112
with:
115-
user: __token__
116113
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
117114
repository_url: https://test.pypi.org/legacy/
118115
```
@@ -127,7 +124,6 @@ would now look like:
127124
- name: Publish package to PyPI
128125
uses: pypa/gh-action-pypi-publish@release/v1
129126
with:
130-
user: __token__
131127
password: ${{ secrets.PYPI_API_TOKEN }}
132128
packages_dir: custom-dir/
133129
```
@@ -181,6 +177,18 @@ It will show SHA256, MD5, BLAKE2-256 values of files to be uploaded.
181177
print_hash: true
182178
```
183179

180+
### Specifying a different username
181+
182+
The default username value is `__token__`. If you publish to a custom
183+
registry that does not provide API tokens, like `devpi`, you may need to
184+
specify a custom username and password pair. This is how it's done.
185+
186+
```yml
187+
with:
188+
user: guido
189+
password: ${{ secrets.DEVPI_PASSWORD }}
190+
```
191+
184192
## License
185193

186194
The Dockerfile and associated scripts and documentation in this project

0 commit comments

Comments
 (0)